iOS ArcGIS.framework too large, hence large .ipa size - ios

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?

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.

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.

Related

How to get the size of an iOS app without being enrolled in the developer program?

I want to analyze the size of an iOS app I created using flutter. As per this flutter doc, you have to archive your app in Xcode and distribute it (Ad Hoc, Development, or Enterprise) after to see the size of your app. However, I am, unfortunately, not enrolled in the apple developer program since I'm only doing some testing for my bachelor's thesis and thus can't distribute it.
So how do I get the size of my flutter iOS release build?
One thing I did try, was just checking the app size in the iOS settings (General>Storage), but I'm not sure that's really accurate because the flutter release build is surprisingly a lot bigger in size compared to the debug build (110 MB vs 230 MB) according to the settings.
Select "Generic iOS device" from the list of devices.
Build your project.
Search for .app file and copy that file to some other location.
Zip that file.
Change extension from .zip to .ipa. It will reconfirm if you want to keep the same or update it to the new one.
This will give you APPROX size of your app.
Please check section Create the App Size Report in below link https://developer.apple.com/documentation/xcode/reducing_your_app_s_size

Xcode 11.4 - Why my application size is increased from 8 MB to 80 MB with just iOS 12.0 support

I just add changed the target from 13.4 - 12.0 and my app size is size from 8 MB to 80 MB.
Can I reduce the size again with iOS 12 support?
The most likely reason is that your app uses Swift and the IPA needs to include the Swift framework for old OS versions.
But, not to worry, your IPA contains everything that any device could possibly need, but the App Store makes thinned versions so that users only download what they need.
To get an idea of what that would be, upload your IPA to AppStoreConnect and look in the "Activity" section of your app. Choose the build, and then look under "Compressed File Size" and click "App Store File Sizes" which will give you download and install size.

After adding HereMaps ipa file size is increased from 10 MB to 300 MB

I am developing IOS APP we have the requirement to use heremap in the app. After adding here map framework my ipa file size is increased from 10mb to 300mb. I noticed that NMAKit.framework folder it self showing 517 MB
To integrate here map framework in my project i followed the instructions from https://developer.here.com/documentation/ios-starter/topics/app-create-simple.html
Is there any way to decrease the size of my ipa file?
The framework contains all architectures, that's why it's quite big. In the end, the app deployed on the phone will only get the target architecture. So the 300MB are not what ends up on the device.
You can strip out manually the emulator architectures from your IPA via the included strip_sim.sh file.
You can also remove unneeded fonts, as described here https://developer.here.com/documentation/ios-premium/topics/size-management.html which will also give you some more MB.

Xcode 8.3 makes exceptionally large (.ipa) file for Unity IOS Build?

We have successfully launched our Unity Game in Android, where it is finally making final .apk file of size 28mb.
When we exported our product's build to Xcode 8.3 and started making archive for uploading to iTunes Store, it surprisingly responded with a final (.ipa) file of very huge size, that is 160mb.
We tried alternatively after removing the unwanted assets and the made another .ipa file which had a minute effect and reduced the size to 159.4mb.
We are also developers of IOS and WatchKit apps, we know that Xcode is not an ideal tool, and has bugs like encapsulating the original size, but we never experienced such an issue before, as our apps compressed size never went this much high. Average size for our products compressed size has always remained 30-40mb, even the biggest of them.
This game is a 2D game with no such high resolution media, that really could be responsible for such hillarious size.
Here we have the report for unity build for IOS:
Secondly, we have this report for the .ipa file made in Xcode.
And finally also the plist with the report of exporting Xcode's .ipa file.
There are 3 reasons for this:
1.)
Xcode 8.3.0 has a bug that creates larger builds. In our case it was 15% bigger then usual.
This has been fixed by Apple in Xcode 8.3.1 and later and Apple now rejects uploading builds created with Xcode 8.3.0.
2.)
The size of App Store Builds is bigger than then what the user will download on it device, since it contains all the bitcode variants for each architecture (armv7, armv7s, 64bit) or target device.
Additionally there is a difference between the downloaded compressed file size and the app installation size. Which you can examine after the upload in iTunes Connect under the app > "Activity" Tab and then "All Builds".
In our case the AppStore IPA was 181MB big. The compressed file size 69MB and the installation size 87MB. This ratio between compressed file size and install size, might vary depending how good the compression works on your assets. I had also an case of compressed file size 618MB and installation size of 1.37 GB.
3.)
Android does not unzip its APK on installation but read/streams data directly from it without extracting it fully on the filesystem. (see also my answer here on a similar issue)

Enabling Bitcode for iOS 9 increases IPA size 3x, is this the size on the app store?

Before iOS 9, our IPA size was roughly 6MB. After Archiving and exporting our IPA through Xcode 7, our IPA increased to about 17MB. Upon further investigation, we found out that enabling the "Bitcode" option in the export settings is what caused the large filesize jump.
My question is this: if we enable this option, will our IPA size be 17MB in the store? Or does Apple do something with the bundle to make it roughly the same size as before (6MB).
There's not much info about Bitcode out there right now, and I'd like to be informed before submitting to the store. 6MB and 17MB is enough of a difference to be concerned.
Bitcode is an intermediate representation of a compiled program. Enabling it will increase the build (ipa) size on the developer front.
iOS can run on different CPUs (i386, x86_64, arm, arm64, etc.), if you want to run a program on any iOS setup, then the program should contain object code for each platform. When you run a program, OS reads the ‘Table Of Contents’ and looks for a slice corresponding to the OS CPU. For instance, if you run on x86_64, then OS will load object code for x86_64 into memory and run the program.
Currently, all the apps on the AppStore contain object code for arm and arm64 CPUs. Moreover, third-party proprietary libraries or frameworks contain object code for i386, x86_64, arm, and arm64, so you can use them to test the app on device and/or simulator.
How does the Bitcode works?
When you submit an app (including Bitcode) Apple’s ‘BlackBox’ recompiles it for each supported platform and drops any ‘useless’ object code, so AppStore has a copy of the app for each CPU. When an end-user wants to install the app - she installs only the version for a particular processor, without any unused stuff.
Bitcode might save up to 50% of disk space per program.
Reference: http://lowlevelbits.org/bitcode-demystified/

Resources