Does the App Store remove architectures from an IPA? - ios

Since the announcement by Apple that all apps distributed by the App Store require 64-bit support, I've had to build multiple-architecture fat binaries that increase the size of the resulting IPA. Does this size increase directly affect my users, or does the App Store strip out irrelevant architectures from an IPA containing fat binaries when downloading to a device?

It does not appear that they currently do, since that feature was announced for iOS 9.
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.

Related

Build Size is Different

I have Create Build with development Certificate the App Size is 10 MB, But i have create build for distribution certificate for uploading to App Store the App Size is 99 MB.
It's not surprising that the distribution version is larger than the development version. When you build an app for a specific device during development, Xcode only needs to compile a binary for one processor, and it only needs to include the resources that would be used on that device. When you build for distribution, Xcode builds a fat binary that includes slices for every processor. The uploaded package also has to include versions of each image resource at all the resolutions that might be used on any device. The result is an application archive that includes a lot more than what's needed for any single device.
The fact that the package you upload to the App Store is large doesn't mean that the app that your users eventually download will be as large, though. The App Store will use app thinning to deliver only those components that are needed to each device.

Why is the same app different sizes on different devices

I released my first app in the AppStore right before Apple's holiday break. On the iPhone the size of app listed in the App Store is 15MB. However, the exact same app on iPad is 28.8MB according to AppStore page.
Why is there a the huge size difference if both the apps have everything the same?
Do they? I do not think so.
Apple sends only the images along with the app file that the particular devices needs. The non-retina devices will have really tiny size while the app for the iPhone 6S Plus will be a lot larger.
The term used for that procedure is App Thinning. What I mentioned regarding the images is a part of that and called Slicing
Apple has introduced a concept called App Thinning with iOS 9. It contains three strategies to reduce the download size of you App:
Slicing: In short only the images and resources needed for a specific target device are delivered. If someone downloads the App with iOS 8 or earlier, the full package will be downloaded
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
Bitcode: If active, Apple can optimise your code for a specific device. For example deploy with 32 or 64 Bit compiled code
On demand data sources: Must be used explicitely by you

Is bitcode required in order to allow users to download only the executable architecture needed for the target device?

My app size is huge, almost 100MB for an ordinary Mahjong game made with Unity3D. I'd like to provide smaller downloads for my audience.
Most of the problem comes from the executable code embedded in the fat binary (armv7 and arm64 architectures). I don't use a lot of images and using On Demand resources/levels does not make much sense in my game.
Looks like App Slicing feature from Apple is the way to go, since it allows iOS 9 users to download from the App Store the app variant containing only the executable architecture needed for the target device.
Since I'm using 3rd party frameworks that don't support bitcode, me question is:
Is bitcode support required for my purposes? Does the App Store require bitcode in order to 'slice' my app for iOS 9 users?
In case bitcode is not required, do I need to set my deployment target to iOS 9 or can I still support iOS >= 7 and take advantage of App Slicing for the iOS 9 users?
1) As you can see in the Apple Doc App Slicing and Bitcode are two different things so yeah, it will work iOS9 users
2) Same link
Note: Sliced apps are supported on devices running 9.0 and later; otherwise, the store delivers universal apps to customers.
So you can continue to target iOS7, Apple will do the job
N.

Can iOS users with older devices see and download a previous version of my app?

My app is currently available in the App Store for both armv7 and arm64 architectures. Let's say it is the version 1.0.
Due to the large size of the binary I'm considering the idea of targeting only 64-bit devices to avoid the armv7 and armv7s slices in the fat binary. Bitcode is currently not an option due to 3rd party frameworks (specially Google) so 64-bit targeting is my last resort. Let's say it will be the version 2.0.
What happens when an user if a armv7 device looks up my app on the App Store?
AFAIK, If the user has previously downloaded the app version 1.0, it will be given an option to download 1.0 again (i.e.: restore the previous download).
However, what if the user has never downloaded the app before? Will it be given the option to download 1.0 as the 'last compatibly' version of the app? Or will it be forced to download 2.0, which does not run in the user's device?
I'd like to submit an arm64 update without restricting my audience (there's no problem if armv7 users still use a previous version of the app).
EDIT
As pointed out by Nicolas Braun, since my app currently supports both armv7 and arm64 I'm not able to submit an arm64-only update since it would restrict device requirements.
What if I submit an update that requires iOS >= 9 without bitcode support, would customers be able to download the variant that contains only the executable architecture needed for the target device?
First once you made an application available to a set of devices your are not allowed to add technical restrictions (ie device capabilities) that will prevent it from running on devices that were previously compatible.
It is stated in Apple Doc even though really not clear:
Important: All device requirement changes must be made when you submit an update to your binary. You are permitted only to expand your device requirements. Submitting an update to your binary to restrict your device requirements is not permitted. You are unable to restrict device requirements because this action will keep customers who have previously downloaded your app from running new updates.
The only parameter you can change that restrict the compatible devices is the minimum OS version. More specificaly
Developers can add restrictions to UIRequiredDeviceCapabilities on app updates provided any device that is dropped cannot support the min os version specified.
Source
That said I believe App Thinning will work on iOS9 no matter if Bitcode is activated or not. Taken from Apple App Thinning doc
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 can see in the same link that bitcode is not the same thing.
Cheers,
Nicolas

ENABLE_BITCODE in xcode 7 should provide all image sizes for XCode?

I am using some images with only 1x and use it for all sizes and some images are only 2x ,
Now by enabling the bitcode flag in Xcode should regenerate all images with three sizes?
also the splash screens and icons should i added it to the image asset catalogs or the keep it on the project as files does this affect the app size?
Firstly, Bitcode is a total different concept which generates intermediate representation of a compiled program. This SO thread beautifully explains about it.
I believe you are looking for Slicing. Per Apple Documentation:
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. Image resources are
sliced according to their resolution and device family. GPU resources
are sliced according to device capabilities. When the user installs an
app, a variant for the user’s device is downloaded and installed.
Trusting you are talking about Slicing:
In Xcode, specify target devices and provide multiple resolutions of
images in the asset catalog.
So you should provide all target device images in asset catalog for slicing to work effectively.

Resources