The original iPhone, iPhone 3G, and iPod Touch of the first and second generations only support armv6 CPU instruction sets. However, with the iPhone 3gs
With the release of this new product, Apple began to support the new instruction set armv7. All iPhone 5 devices support armv7s and are backward compatible. To maintain backward compatibility and support legacy devices and instruction sets, Apple supports fat binary codes (fat binaries), that is, more platform architectures in executable files.
However, it is not a long time. With the release of xcode 4.5, the latest version of xcode, Apple announced that it would stop supporting armv6 instruction sets and force developers to abandon IOS 4.2.1 and earlier versions that support armv6 instruction sets. In my opinion, I still think that the enterprise market for supporting old devices must be longer than the public market, so I didn't want to give up 4.2.1 or earlier versions. After a period of exploration, we were lucky to find some ways to compile the armv6 Instruction Set code through simple modification and configuration.
Here are some of our methods for your reference:
- Find a copy of the old version of xcode. 4.4.1 is recommended. If you are a participant in the IOS Developer Program, you can download it directly from mongo.apple.com/ios. If not, ask Baidu
- Decompress xcode and copy SDK contents/developer/platforms/iphoneos. Platform/developer/sdks/iphoneos5.1.sdk/
- And then port the copied SDK to xcode 4.5. Example: Contents/developer/platforms/iPhone OS. Platform/developer/sdks/
- Open the project in xcode and click "build Settings" to view the "build Settings" attribute. A new option "base SDK" is displayed: IOS 5.0 is selected.
- Under build settings, find valid ubuntures. Change armv7s to armv6
- Now we can compile armv6, but it cannot run on any armv6 device, because the target is incorrect. Click the info option to modify the target, such as IOS 3.0 or earlier versions. You won't find 3.0 in the down menu.
The above is all the practices, but it is not perfect. For example, you cannot use the new features of iOS 6 or the new armv7s instruction set. Of course, if your xcode is downloaded through the Mac appstore and upgraded to the new version, you need to add the SDK again.