read

Sometimes you need to run an app on simulator without building in Xcode. It is especially useful for QA/Test engineers. While they usually has an arsenal of iPhones, there is 1 particular case that is not friendly to test.

Firebase analytics does not show up in real time, except in debug view.

Yet to run in debug view, you need to pass a command line argument.

But without access to Xcode run scheme, QA can’t launch with debug view. So here’s how developers can help QA test on iPhone simulators.

Step 1: Zip and send the app

When we build an app, it can be found in ~/Library/Developer/Xcode/DerivedData/MyApp-abc/Build/Products.

An easier way is to build in Xcode > Project Navigation > Products > Right click the app > Show in Finder.

Zip the app and send to QA.

Step 2: QA install the app

QA still needs to install Xcode, so that they can run Simulator app. To run, simply use spotlight to search for Simulator.app and open it.

To install the iOS app, the easiest way is unzip, then drag and drop on the Simulator app.

With that, QA can already test with all the iPhones in the world.

You deserve a raise helping your company save tons of 💰 with this simple 2-step process.

Step 3: Launch with arguments

This takes a bit more work, as QA needs to run a few commands on the terminal/iTerm.

# Search the devices eg. iPhone 14, and copy one of the device UUID
xcrun simctl list devices "iPhone 14"

# Boot the simulator using the UUID. We use ABCD-1234 as an example.
xcrun simctl boot ABCD-1234

# Wait for the simulator to bootup.. Ensure Simulator.app is opened.

# Launch the app with arguments
xcrun simctl launch ABCD-1234 com.just2us.myapp -FIRDebugEnabled

That’s it!

We have only used 3 subcommands above: list, boot and launch.

You can do more such as manipulating keychain, environment, container, revoke privacy, mock location, send push, etc. Read up with xcrun simctl help subcommand.


Image

@samwize

¯\_(ツ)_/¯

Back to Home