I'm trying to profile app launch of an iOS app running on an M1 Mac. After downloading a Mac compatible app from the iOS App Store (Airbnb) I'm able to select it in instruments by selecting the .app in /Applications
This allows me to launch the app and profile it by pressing the record button
Now I want to do this in an automated way with xctrace so I ran :
xcrun xctrace record --template 'App Launch' --device CE3D229D-A2BF-5455-8923-5D49498F06DC --launch -- '/Applications/Airbnb.app'
Using the id of my Mac returned from xcrun xctrace list devices
. This attempts to launch the app but it immediately crashes with an error about an invalid code signature:
If I try the same process with a MacOS app like Twitter, instead of an iOS app running on Mac, I'm able to launch it with xctrace. I'm also able to attach to Airbnb using the --attach PID
option, but this doesn't help for testing app launch.
I also tried launching the internal iOS .app using: xcrun xctrace record --template 'App Launch' --device CE3D229D-A2BF-5455-8923-5D49498F06DC --launch -- '/Applications/Airbnb.app/Wrapper/Airbnb.app'
but got the same crash.
How can I use the command line to launch an iOS app for profiling instruments?
This is using Xcode 12.5.1 on macOS 11.5.2