simctl: Control iOS Simulators from Command Line

Shashikant Jagtap
Jun 4, 2017 · 6 min read

While developing iOS apps, simulators are the best friends of developers. It’s the quick and easy way to test app while development as we can interact with iOS simulators using GUI. Apple’s documentation on getting started in simulator is awesome and we can learn almost everything about controlling simulators from using graphical user interface.

Although, simulators are easy to use with GUI, it’s bit painful to script simulator interactions to run on Continuous Integration server. Fortunately, Apple has nice command line utility called “simctl”.

In this post, let’s see how to use ‘simctl’ to interact with iOS simulators. We will cover following

  • Creating, Deleting and Booting Simulators
  • Adding photos and video to simulators
  • Installing/Uninstalling, launching/Terminating app inside simulator
  • Capturing screenshot and record video of simulator
  • Collecting the simulator logs and other tricks


Apple has ‘simctl’ binary to interact with iOS simulators from command line. It’s very similar to the adb for Android. Again it’s another utility poorly documented by Apple but we can find binary at /Applications/ and we can use it with xcrun utility . We can access all the available options using the help command

We can perform various actions on iOS simulator using ‘simctl’ from creating new simulator, erasing simulator, installing app inside simulator, add photo/video to simulator and may more. Let’s look into few of them in details.

Listing all available simulators

We can easily list all the available simulators using command

This command will list all the available simulators with runtime. It will also show ‘booted’ simulator if it’s running already.

CRUD operations on Simulators

We can create, erase, delete, boot, shutdown and upgrade simulators using simctl.


We can easily create new simulator called ‘My-iPhone7″ on top of existing iPhone7 (iOS 10.3) simulator using command

We can see that newly created simulator using list option and we have UUID for the simulator ‘C86A559A-1F50–40D1–8D84–954EDFBBCE18′


As we have already seen that, there is another simulator already booted, let’s shut it down and erase it’s content. The order is important here, we can’t erase simulator in the booted state, we need to shutdown first then erase.


Now let’s boot the newly created simulator using new UUID

Now that, we have learned how to shutdown, boot and erase simulator. Let open any simulator by using

You can see that simulator is booting.

Add Photo/Video to Simulator

An iOS simulator by default has 5 images but we can add more images or video using simctl addmedia functionality. Let’s add one photo(png) and on video(gif) inside our simulator which is kept on desktop.

Now, simulator will have another photo. Similarly, we can add video as well.

Install/Uninstall app inside Simulator

We can easily install our app inside simulator from command line if we already have path to .app file from derived data. Let’s create new single view app in Xcode and name it “CLI” and save it on desktop. We need to build the app using xcodebuild to get in the derived data.

Now, we will get the inside derived data, in my case it’s inside /Users/shashi/Library/Developer/Xcode/DerivedData/CLI-dxasphjukowuptcqxzbmyaqgpbqp/Build/Products/Debug-iphoneos/ directory.

We can install our inside simulator using

Watch the GIF below where we are installing

Similarly we can uninstall our iOS app from simulator easily. We need to know the bundle identifier of our app. In my case it’s test.CLI we can uninstall app using

Launch/Terminator app inside Simulator

Similar to installation, we can launch and terminate an app using command line using simctl. We have to make sure app is installed before we launch.

We can see that app is launched, we can then terminate app using

Screenshot and Video Recording of Simulator

In Xcode 8.2, Apple introduced this really nice feature of capturing the screenshot and recording video of the simulator. Now it’s easy to capture screenshot of the simulator. We can capture current state of simulator using

This will save the screenshot of the simulator in the current working directory with file screen.png

Similarly, we can record video of simulator while using app and save it on disk using

This will save video of the simulator to to file which can be played using Quick Time player or similar.

Collecting Simulator Logs

Sometime it would be helpful to print the simulator logs as console output. We can easily determine activity of the simulator by reading the logs. Let’s print the logs of simulators

we can also filter the log output if you looking for logs of particular app

Miscellaneous Bulk Actions

There are couple of dirty hack which might be useful as well in some cases when you don’t want so many simulators.

Erase all Simulators

We can erase all the simulators using the simple command

Delete all the Simulators

The following script will delete all your simulators so beware of the impact and use when really needed.

Find Simulator by Name Regex

Sometimes we might need to find the simulator by name and perform action on that UUID. We can find that UUID using name and then erase/delete/boot simulator. Let’s erase simulator containing name “Shashi”


Using simctl utility we can programatically interact with iOS simulators and script the setup for test execution on CI servers. What’s your experience with ‘simctl’, comment below.

Like this post from XCBlog By XCTEQ ? You may also like some of our services like guest blogging or Mobile DevOps(CI/CD) or Test Automation. Chekout our services, open source projects on Github or Follow us on Twitter , Facebook, Youtube , LinkedIn. Download Our XCBlog iOS App to read the blogs offline.

XCTEQ Limited: Mobile DevOps, CI/CD and Automation

XCTEQ is a company specialised in Mobile DevOps, CI/CD, Mobile, AI/ML based Test Automation Checkout XCTEQ products and services at or write to us on




P.S: All the posts from this publication are published before author Shashikant Jagtap joined Apple. Thank you so much for being a reader of XCBlog. Tech Blog about DevOps, CI/CD for  Platforms. Xcode Server, XCTest, SwiftPM, Server Side Swift, XCUITest etc.

Shashikant Jagtap

Written by

All the posts published on this channel before I joined Apple. Thanks for being a reader of XCBlog. Web:,


P.S: All the posts from this publication are published before author Shashikant Jagtap joined Apple. Thank you so much for being a reader of XCBlog. Tech Blog about DevOps, CI/CD for  Platforms. Xcode Server, XCTest, SwiftPM, Server Side Swift, XCUITest etc.

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store