If you are a developer with an app in the Mac App Store, then you have probably come across this Apple rule:
Application executables may support either or both of the Intel architectures:
i386 (32-bit)
x86_64 (64-bit)Other architectures may not be included in submitted binaries.
No problem says you. However, until recently, Apple did not check things like dylibs contained within your app bundle. They do now.
This means that you must make sure that any 3rd party components you have imported to your project are stripped of any old PPC remnants or they will fail validation and be rejected within 5 minutes of submission (seems like they have automated these checks).
So how do we do this? Simple enough, but it requires and extra step after building the archive.
- First to be safe, you should check your target build settings to ensure that your target architectures are set to i386 and x86_64. So first click on the Project in XCode, then select the target:
Then, under the ‘Build Settings’ tab look at the ‘Valid Architectures’ and check that it looks like this:
- Then, as normal, build the product for Archive

- The Organser window should open automatically when done. At this point, we’re interested in finding the .app bundle. Where is it? Lets see… Right click on the archive, and select ‘Show In Finder’

- The xcarchive location will be shown. Right click and ‘Show Package Contents’

- Inside here, browse to Products/Users/NAME/Applications/ to see your .app bundle
This is the .app bundle we need to strip non x86 or 64 parts from before signing and submitting to Apple. To do this we can use something like TrimTheFat, by dragging the .app bundle into it’s window and deleting the resulting Jelly SMS Lite-U.app (as it’s not needed any more).Or alternatively, we can run the following command on the .app bundle.
ditto --rsrc --arch i386 --arch x86_64 MyApp.app build/MyApp.app
(from Apple Dev Forums)
If anyone knows of a way this command can be automatically run during the archive or build process (possibly during a build step maybe??), please let us know in the comments below…
[Update] Important: I forgot to mention – you should launch your .app at this stage to test if you’ve actually stripped out something that your app depends on. If so, you will get a crash here. In this case you will need to look at your project more closely and remove the code/parts causing the exceptions.
Now you can simply submit your archive as before and the nasty stuff should all be gone from it and you will once again be in Apple’s good books.
Good blog post Finn. I know this one will trip a lot of people up. I suspect that you could run lipo on object files as part of the build process. I’ve not tried it, but this may be a good place to start.
Also, if you’re never going to build PPC, why not trip the fat from all 3rd party libraries anyway? Then perhaps you won’t have to do this manual step?
Good points Dermot. If ther was a way or a tool to auto strip the fat on import, that could be perfect. I’m sure something like that will emerge very soon after a few hundred devs hit this issue.
In the meantime, I’ll see if I can suss out stripping as part of the build process… Cheers!
You could add a ‘run script’ phase to your Xcode build that automates this before the app gets archived. I’ve done similar in the past, works well!
Aha yes. That’s what I was looking for! Thanks Steve…
Great tip! Ran into this when using XCode4 (was able to submit without issues previously with XCode3). Thanks!