We got this working with the following gym
invocation:
archive_path = gym(
skip_package_ipa: true,
destination: "platform=iOS Simulator,name=iPhone 6",
configuration: "Debug",
build_path: "simulator_build"
)
This will spit out an .xcarchive in the directory "simulator_build/" containing a simulator-compatible .app file.
archive_path
will be the absolute path to the created .xcarchive bundle.
name=
needs to match the name of an existing simulator device shown in the output of xcrun simctl list
. The iPhone 6
one exists by default, so it should be a safe option.
Before dragging this file to the simulator to install it, you need to whitelist it with Gatekeeper:
spctl --add ~/project/simulator_build/Products/Applications/YourApp.app
If you forget, you'll get a "… can't be opened because it is from an unidentified developer." error when clicking the app in the simulator.
If you get "… is damaged and can't be opened. You should move it to the Trash.", something has changed about the .app since it was codesigned. Use
codesign -vvv ~/project/simulator_build/Products/Applications/YourApp.app
to see what file(s) have been added, removed, or changed since codesigning.