Submit to App Store issues Unsupported Architecture x86
Interview Questions practice on Codemia
Over 8,000 real interview questions from top companies, searchable by company and role.
When developing an application for iOS and submitting it to the App Store, developers often encounter a variety of technical hurdles. One of the common issues is related to "Unsupported Architecture x86". This article dives deep into this problem, providing technical explanations and offering guidance on how to resolve it effectively.
Understanding the Architecture Issue
Apple's App Store requires applications to be compiled for ARM architectures (armv7, arm64, etc.) because these are the architectures used by iOS devices. The x86 architecture, on the other hand, is typically used for simulators on macOS. An application that includes x86 architecture cannot be uploaded to the App Store, which results in a rejection.
Why is x86 Part of the Issue?
The x86 architecture's inclusion usually happens during the development phase for use in the iOS Simulator, which runs on a Mac's CPU architecture. If not properly excluded during the build process, binaries containing x86 architecture may be inadvertently submitted to the App Store:
- x86: Used by 32-bit x86 apps on Macs.
- x86_64: Used by 64-bit applications running on the macOS environment, like simulators.
These architectures are useful for testing but are unnecessary and unsupported when deploying a release build to physical devices or the App Store.
Symptoms of the Issue
When submitting an app including x86 architecture to the App Store, developers might encounter an error message like:
This error indicates that the app binary contains executable code in the x86_64 architecture, which is not permissible on the App Store.
Solutions to Rectify Unsupported Architecture
Here are steps to ensure your app binaries are correctly configured before submission:
1. Swift Package Manager
When using Swift Package Manager, it’s usually straightforward, but critical check the packaging:
- Ensure no dependencies include unnecessary architectures.
- Testing can be done on simulators but make sure to strip these architectures before archiving.
2. Manual Stripping Script
A common practice is to add a script in the build phases of the Xcode project. Here is an example script to remove simulator architectures:
3. Using EXCLUDED_ARCHS in Xcode
Xcode allows the setting of architecture rules. Doing this filters out unwanted architectures.
- Select your project and target in Xcode, go to the Build Settings, and look for Architectures.
- Set the
EXCLUDED_ARCHStox86_64,i386for Release builds.
4. Validating the Final Binary
Always make a final check on your binary using command-line tools before submitting:
This command lists the architectures included in the final binary, helping ensure that only supported architectures remain.
Table Summary of Key Points
| Aspect | Description |
| Cause | x86 architectures are included during simulator testing. |
| Symptoms | Errors from App Store submission, such as "unsupported architecture". |
| Solutions | Stripping script, set EXCLUDED_ARCHS. |
| Tools | Xcode's Build Settings, command-line tools like lipo. |
| Validation Command | for verifying architectures. |
Additional Considerations
Checking Third-Party Libraries
Ensure that any third-party libraries included in your project are also correctly architectured. Static libraries can especially often have redundant architectures which need to be stripped away in a similar fashion.
Automating the Process
To simplify development workflows, consider automating the stripping process using CI/CD pipelines or pre-submit hooks, ensuring unwanted architectures are never mistakenly submitted.
By understanding the intricacies of iOS architecture requirements and implementing these solutions, developers can avoid the hiccups associated with unsupported architectures during App Store submissions. It not only accelerates the deployment process but also aligns with best practices in developing for iOS.
By following the above recommendations, you ensure that your app is free of unsupported architectures so that submissions to Apple's App Store go smoothly.
Related reading
- Super slow lag/delay on initial keyboard animation of UITextField
- Suppressing deprecated warnings in Xcode
- Swift3 iOS - How to make UITapGestureRecognizer trigger function
- Swift - Cast Int into enumInt
- Swift - Cast Int into enumInt
- Swift - check if a timestamp is yesterday, today, tomorrow, or X days ago
- Swift - check if a timestamp is yesterday, today, tomorrow, or X days ago
- Swift - class method which must be overridden by subclass
.png&w=3840&q=75)
Tackling System Design Interview Problems
A short course that equips you with the skills to approach system design interviews methodically.
Start the free courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
Interview Questions practice on Codemia
Over 8,000 real interview questions from top companies, searchable by company and role.