What are the benefits/consequences of compiling an armv7 only architecture?
Asked Answered
R

2

14

In compiling iPhone apps, there is a setting for "Optimized" architecture (armv7 only) vs a standard armv6/armv7 architecture.

What are the benefits/consequences of compiling an armv7 only architecture?

Reduplicative answered 30/5, 2010 at 19:44 Comment(0)
L
13

A smaller executable is a faster download from the app store. However, you do cut out non-armv7 devices.

Lewiss answered 30/5, 2010 at 21:11 Comment(5)
out of the current line-up, what are the devices that are not armv7?Reduplicative
Probably the iPhone, iPhone 3G, iPod Touch 1st and 2nd gen.Lewiss
@Alex For people who have iPhone 3G, what happens when the app is in the app store ? They can't download the app or the app is crashing when they launch it ?Haldes
Apple will probably disapprove the App if you haven't flagged in accordingly (in Info.plist) to only run on 3rd generation and above devices. They way to do that I believe is to specify that your app requires OpenGL ES 2.0. The image in this blogpost (meachware.blogspot.com/2010/08/infoplist-cheat-sheet.html) shows you the correct setting (opengles-2).Neilson
To flag your app is for armv7 only in the App Store, you add "armv7" to the UIRequiredDeviceCapabilities list in Info.plist.Karnak
M
19

Unless your program requires OpenGLES 2.0 (which is only supported on armv7-supporting devices), you should compile the standard fat (armv6/armv7) binary. A fat binary is basically two (or more) Mach-O binaries glued together, with a single header page at the beginning. The performance cost is negligible: the dynamic loader must take an extra page fault for the header page to determine which architecture to load.

Building for armv7 only will essentially halve the size of your executable, although it's unlikely that your executable is all that large to begin with. You can use the "size" and "otool" commands on the host to get more information about the various sections in your app's binary, e.g. "size -arch armv6 build/Release/MyApp.app/MyApp" will get the size of various sections in the armv6 version of a binary, "size -arch armv7 build/Release/MyApp.app/MyApp" will get the size of various sections in the armv7 version of a binary, and obviously "ls -l build/Release/MyApp.app/MyApp" will get the actual file size of the binary.

Mutinous answered 31/5, 2010 at 21:11 Comment(0)
L
13

A smaller executable is a faster download from the app store. However, you do cut out non-armv7 devices.

Lewiss answered 30/5, 2010 at 21:11 Comment(5)
out of the current line-up, what are the devices that are not armv7?Reduplicative
Probably the iPhone, iPhone 3G, iPod Touch 1st and 2nd gen.Lewiss
@Alex For people who have iPhone 3G, what happens when the app is in the app store ? They can't download the app or the app is crashing when they launch it ?Haldes
Apple will probably disapprove the App if you haven't flagged in accordingly (in Info.plist) to only run on 3rd generation and above devices. They way to do that I believe is to specify that your app requires OpenGL ES 2.0. The image in this blogpost (meachware.blogspot.com/2010/08/infoplist-cheat-sheet.html) shows you the correct setting (opengles-2).Neilson
To flag your app is for armv7 only in the App Store, you add "armv7" to the UIRequiredDeviceCapabilities list in Info.plist.Karnak

© 2022 - 2024 — McMap. All rights reserved.