Shawn Mervin

Xcode CLI and simctl

The Xcode command line tools and simctl are how I build the iPhone app and look at changes in the simulator before they ship.

Visit developer.apple.comAt the command line

What it is

Xcode is Apple's development environment for iPhone, iPad and Mac apps. Its command line tools, run through xcodebuild and xcrun, let a build, test or archive run from a terminal or a script instead of the Xcode window, which is what continuous builds and automation rely on. The same tools sign the app and produce the archive that goes to App Store Connect.

simctl, run as xcrun simctl, controls the iOS Simulator from the command line. It can boot and shut down simulated devices, install and launch apps, open URLs, set the location and take screenshots. That makes it possible to drive a simulated iPhone from a script and capture exactly what appears on screen.

How I use it

  • Xcode and Expo builds for the phone apps run from my terminal.
  • The Rental Pilot field app is on the App Store, built with React Native and kept at feature parity with the web.
  • An agent renders each change in a real browser or the iOS simulator, screenshots it and reports what is actually there, rather than approving on a passing build.
  • That habit catches the class of bug that compiles, deploys and is wrong on screen.

These are the right tools for anyone shipping an iOS app who wants builds and checks to run the same way every time. I reach for simctl in particular because a passing type-check or a green build does not prove the screen is right. Looking at the rendered screen does.

Questions

How do you test an iPhone app before release?

Every change is rendered in the iOS simulator and screenshotted, and the screenshot is read before the change ships. A green build alone does not count.

Has Shawn Mervin shipped apps to the App Store?

Yes. Rental Pilot's React Native field app is on the App Store, and at Brikers I shipped Cordova apps to Google Play and the App Store.

Working with Xcode CLI and simctl?

Tell me what you're building. Start a project or see the whole stack.

Got an operation that's outgrown its spreadsheets?

Tell me what your business does and where it's jamming up. If I'm not the right person for it, I'll say so and point you somewhere better.

What to send, and what happens next