问题
I are maintaining an application with ArcGIS.framework for iOS. I am upgrading from version 10.2~ to 100+. I have prolonged this hoping that at some point the application size problem will be resolved. The application size with the newer framework went up from just 26MB to over 360MB. This will not be accepted by clients. I have been searching for a good and simple way of reducing the app size without using app thinning which requires bitcode to be enable which for some other reasons I can't enable.
Stripping x86_64 and i386 architectures does not reduce the framework size that much.
Are there flags, other compiler or linking settings we can provide Xcode with at compile time?
回答1:
You can take advantage of App Thinning without having to enable bitcode, and if you're targeting iOS 9 and upwards you will only ever see a Thinned .ipa deployed to any device (although a Universal .ipa will get generated and uploaded to iTunes Connect).
In practice, that means if you're using Runtime 100.x, your app will use app thinning.
Here is how we assess this to see what will end up on an iOS 9+ device (required for Runtime 100.2):
- In Xcode's menu, select
Product
->Archive
(make sure you have Generic iOS Device or an actual device selected as the target device). - Once finished, the Organizer window should pop open and you should be able to see the latest archive in the archives tab.
- Select the archive and hit the
Export
button on the right. - Choose
Development
and hit Next. - Choose a team if asked.
- In the
App Thinning
menu, choose a specific device and hit Next. - Select your signing method and hit Next.
- Review the summary, and hit Export.
You will end up with a folder containing the thinned .ipa and some reports on the thinning process, including what usage to expect to see on the device.
For example, here is the App Thinning Size Report.txt
for a Runtime app targeting iPhone 8 (with bitcode disabled):
App Thinning Size Report for All Variants of MyRuntime100App
Variant: MyRuntime100App-iPhone 8.ipa
Supported devices: iPhone 8
App + On Demand Resources size: 31 MB compressed, 89.7 MB uncompressed
App size: 31 MB compressed, 89.7 MB uncompressed
On Demand Resources size: Zero KB compressed, Zero KB uncompressed
So the above app would be an over the air download of 31 MB and would take up 89.7 MB on the device (and that example happens to include a 19.8 MB Mobile Map Package).
Hope that helps.
I would also encourage you to post future questions to our iOS Runtime SDK forum if you can.
回答2:
Adding the arcgis framework manually rather than by cocoa pod will help to decrease its final downloadable size on the devices by about 70 MB Here is how to do that
- Download the SDK from https://developers.arcgis.com/downloads/apis-and-sdks
- Install the .pkg file , it will install by default to ${HOME}/Library folder.
- Open your project on xcode and drag the ${HOME}/Library/SDKs/ArcGIS/iOS/Frameworks/Static/ArcGIS.framework to your frameworks folder of your project through xcode
- Add framework to the search paths of your project https://developers.arcgis.com/ios/latest/swift/guide/install.htm#ESRI_SECTION3_2304BFA5F5A14A679B5A92B2DDEC859E
Note that the ipa size may not different in size but the final downloadable app size will be less by about 70MB.
来源:https://stackoverflow.com/questions/50488350/ios-arcgis-framework-too-large-hence-large-ipa-size