本文介绍了接近大小限制 - 手表应用程序的大小(50MB 限制令人头疼.)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我们的应用程序达到了大约 49MB,我们还没有完成一半.所以肯定会超过50MB的限制.我有以下几个问题.

Our app reaches approx 49MB and we are not halfway. So definitely it will exceed the limit of 50MB. I have few questions as follow.

1) watchOS 中是否可以按需提供资源?

1) Is On-Demand Resources possible in watchOS?

2) 我的资源(图片、自定义字体)制作了 2 个副本,每个副本是手表应用程序,另一个是手表扩展程序.怎么解决?

2) My resources(images, custom fonts) make 2 copy each one is watch app and other is watch extension. How to solve that?

3) Swift 核心和其他 Swift 框架消耗了大约 28MB 的空间.有什么办法可以禁用它吗?(PS.我们禁用了位代码)

3) Swift core and other swift frameworks are consuming about ~28MB of space. is there any way to disable that? (PS. we have bit code disabled)

针对 watchOS4 进行

Edit for watchOS4:

以前我们的应用程序大小为 44.3 MB,但当我们从 xcode9 生成 IPA 时,大小增加到 54.5.

Previously our app size was 44.3 MB but when we generate IPA from xcode9 size increased to 54.5.

推荐答案

您绝对可以通过仅在手表应用程序或手表扩展程序中包含资源来节省空间,而不是两者都包含.对于在故事板中使用或在 WatchKit 方法中按名称引用的资源,例如 WKInterfaceImagesetImageNamed(_:) 方法,您应该将它们存储在手表应用程序本身中.对于通过路径或使用 UIImage 方法(如 init?(named:))加载到代码中的任何资源,您需要将它们放在 WatchKit 扩展中.

You can definitely save space by only including resources in either the watch app or the watch extension, not both. For resources used in your storyboard or referenced by name in WatchKit methods, like WKInterfaceImage’s setImageNamed(_:) method, you should store them in the watch app itself. For any resources loaded in code by path or with UIImage methods like init?(named:), you’ll want to put them in your WatchKit Extension.

这篇关于接近大小限制 - 手表应用程序的大小(50MB 限制令人头疼.)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-06 09:57