设为首页 加入收藏

TOP

iOS9 App Thinning(应用瘦身)功能介绍(二)
2017-10-11 13:57:28 】 浏览:2829
Tags:iOS9 App Thinning 应用 瘦身 功能 介绍
缩,并在 Xcode 中运行。你会发现该项目中除了几张资产目录下的图像(而没有大量的代码),并无太多内容。该资产目录也包含了该应用图标的 1x、2x、3x 版本。

首先,在模拟器或设备上运行该应用。打开设置应用程序,单击「存储空间与 iCloud 用量」 (在非 iOS 的 9 设备上只是「存储」 ),然后选择「管理存储空间」 。向下滚动找到刚刚编译的应用程序,然后点击它。你会发现它大约只有 17.0 MB 大小(当上传到 iTunes Connect 时大小可能略有不同)。 
aa 

当你使用 Xcode 编译和运行一个应用时,Xcode 不会自动处理应用程序变种和 App Thinning。这样,整个应用程序文件还是在你的设备上。
然后点击 Xcode 的产品选项(Product tab)并且选择存档(Archive)。 

注:你有可能需要先修改应用程序的 Bundle Identifier 去匹配你自己创建的程序。否则,该应用程序将无法上传到 iTunes Connect 上。


确保你在选择「提交」之前选择了「包含 bitcode」。如果一切顺利,你会看到一个绿色的对号提示你项目已经成功更新了。
现在点击这里 登录 iTunes Connect ,创建一个新的应用程序(填入适当的捆绑包 ID,应用程序名称等)。如果你不确定怎么做,请参考AppCoda TestFlight 教程

将自己添加为内部测试员。要注意,在建立项目时数个小时都处于「处理中状态并不寻常。一旦应用程序处理完毕,就选中它并按下 开始测试」。
你将会收到一封电子邮件。请确保使用你想测试的 iOS 设备,并接受邮件邀请。你会被带到 TestFlight 应用。 

安装这个版本。完成之后,返回到应用程序设置,浏览存储,找到我们之前的应用程序。发现这个应用程序现在仅有 5.4MB 了。这就是 App Thinning 的杰作! 

哇!你的一个非常精简的应用程序都节省了 12.4MB 的存储空间。那么,包含多个不同资源的应用程序将会得到更加显着的大小变化!

 

参考链接:

http://www.cocoachina.com/ios/20150612/12135.html

http://www.jianshu.com/p/330303ac0410

 

2. 官方网站链接: 

http://help.apple.com/xcode/mac/current/#/devbbdc5ce4f

官网文档

App thinning overview (iOS, tvOS, watchOS)

The App Store and operating system optimize the installation of iOS, tvOS, and watchOS apps by tailoring app delivery to the capabilities of the user’s particular device, with minimal footprint. This optimization, called app thinning, lets you create apps that use the most device features, occupy minimum disk space, and accommodate future updates that can be applied by Apple. Faster downloads and more space for other apps and content provides a better user experience.

Slicing (iOS, tvOS)

Slicing is the process of creating and delivering variants of the app bundle for different target devices. A variant contains only the executable architecture and resources that are needed for the target device. You continue to develop and upload full versions of your app to iTunes Connect. The App Store will create and deliver different variants based on the devices your app supports. Use asset catalogs so that the App Store can select images, GPU resources, and other data appropriate for each device variant. When the user installs an app, a variant for the user’s device is downloaded and installed.

Xcode simulates slicing during development so you can create and test variants locally. Xcode slices your app when you build and run your app on a device or in Simulator. When you create an archive, Xcode includes the full version of your app but allows you to export variants from the archive.

Note: Sliced apps are supported on devices running 9.0 and later; otherwise, the App Store delivers universal apps to customers.

Bitcode

Bitcode is an intermediate representation of a compiled program. Apps you upload to iTunes Connect that contain bitcode will be compiled and linked on the App Store. Including bitcode will allow Apple to re-optimize your app binary in the future without the need to submit a new version of your app to the App Store.

For iOS apps, bitcode is the default, but optional. For watchOS and tvOS apps, bitcode is required. If you provide bitcode, all apps and frameworks in the app bundle (all targets in the project) need to include bitcode.

Xcode hides your app’s symbols by default, so they are not readable by Apple. When you upload your app to iTunes Connect, you have the option of including symbols. Including symbols allows Apple to provide crash reports for you

首页 上一页 1 2 3 下一页 尾页 2/3/3
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇属性动画(显示动) 下一篇事务(隐式动画)

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目