Do we need to compile iOS App for both “armv7” and

2019-07-22 11:56发布

My App supports from iOS8.0 and above. And I know that from iOS7 onwards its arm64 bit architecture. In that case do we need to compile the binary for both "armv7" and "arm64" slices?

If I compile for arm64 alone, I can reduce my App size. Is it a right way ?

Please help.

3条回答
够拽才男人
2楼-- · 2019-07-22 12:36

As per my understanding from Apple docs, The size of App will be reduce when you compile it for specific architecture & its correct way of doing it.

Apple docs :

Target Fewer CPUs

By default, Xcode projects are configured to generate optimized copies of your app in CPU-specific "slices" of your executable. Different hardware will run a different slice of the executable. This enables powerful optimizations that are only possible on some devices. However, this can substantially increase the size of your app's executable.

To target only specific CPUs, change the Architectures build setting from Standard $(ARCHS_STANDARD) to a list of the names of specific CPUs you want to support. Valid CPU names are listed in the Valid Architectures (VALID_ARCHS) build setting. Do not change the Valid Architectures setting. It is vestigial, and best managed by Xcode.

For more info refer this

查看更多
仙女界的扛把子
3楼-- · 2019-07-22 12:38

enter image description here

You need to build the app for both of these

查看更多
一纸荒年 Trace。
4楼-- · 2019-07-22 12:42

Here you can find very easy to understand explanation of all iPhone and also Mac CPU architectures:

Mac and iPhone CPU Architectures

It helped me a lot when i desided to remove armv7 architecture from my supported arcitectures:

Choose carefully when excluding architectures. An application build with armv7 will run on all current iOS devices, even those that support newer architectures (it will run as 32-bit on iPhone 5S and later). But on the other hand, an app build without armv7 will not run on older devices such as the iPhone 4/4S or the original iPad mini.

查看更多
登录 后发表回答