TL;DR
iOS Simulator builds are not somewhere underneath ~/Library/Developer/Xcode/DerivedData
anymore, but in ~/Library/Developer/CoreSimulator/Devices
.
Simulator build for e.g. Meta/Facebook App review
If you build an iOS or Android app that integrates with the Facebook SDK, you need to have your app reviewed before being able to go live.
As part of this App Review process voor iOS, you have to submit a simulator binary package of your app to Facebook.
Part of the instruction is to run the app in your simulator, and then look into ~/Library/Developer/Xcode/DerivedData folder
.
But, since XCode 14 this does not work anymore, and up until now the Facebook documentation is not up to date yet. 😱 So the whole day I've been looking for "Where does XCode (or Flutter command line in my case) drop my compiled app, that is run on my Simulator?".
As it occurs, that is ~/Library/Developer/CoreSimulator/Devices/<<hash of your device>>/data/Containers/Bundle/Application/<<hash of your app>>/<<name of target>>.app
🎉
Bonus; one-liner to get a Zipfile of the simulator build
How to get a zipfile of your simulator build, that you can send to Facebook right away?
- Run your app in the emulator
- Execute the following line in your shell:
ditto -ck --sequesterRsrc --keepParent `ls -1 -d -t ~/Library/Developer/CoreSimulator/Devices/*/data/Containers/Bundle/Application/*/*.app | head -n 1` ~/Desktop/your_app_$(date +"%Y%m%d_%H%M").zip
This will take the most recent app from underneath your CoreSimulator
folder, puts it in the most small and optimized archive for Facebook and drops it at your desktop, while having a timestamp. Feel free to change this one-liner to your liking 😉
When having the zipfile on your desktop, it's smart to check if it's working before submitting to Facebook.
To test the Zipfile:
- Extract the zip
- Install
ios-sim
if not done yet:npm install -g ios-sim
- Test your file with:
ios-sim launch --devicetypeid com.apple.CoreSimulator.SimDeviceType.iPhone-14 ~/Desktop/Runner.app
Good luck! 👋
Top comments (0)