Launch iOS Simulator with Command Line

In this tutorial, you will learn how to check current simulator list, and launch a specified simulator.

Check Simulator List and Launch Simulator

Use following command to launch a specified UDID simulator:

$ open -a Simulator --args -CurrentDeviceUIDI <your simulator UDID>

To get the UDID of the simulators you can use following command:

$ xcrun simctl list

Output looks like:

== Device Pairs ==
9B9A41D6-380E-4EA0-A3AE-C6005BD9AD7B (active, disconnected)
    Watch: Apple Watch Series 5 - 40mm (431F1E60-A78F-4810-91C5-D84757D05A5A) (Shutdown)
    Phone: iPhone 12 mini (CC4BE9DD-729B-41B4-8C0D-24B0BC215DC5) (Shutdown)
EED9E7F7-142D-4FD2-B41B-5E83EFBC16C1 (active, disconnected)
    Watch: Apple Watch Series 5 - 44mm (E39AA7B5-A6BC-4F44-A11D-847EDA5E119C) (Shutdown)
    Phone: iPhone 12 (8BF9D420-0911-41BD-840C-8BA319F21CD9) (Booted)
0941B870-2BDE-4734-ACC8-3E56A3C81382 (active, disconnected)
    Watch: Apple Watch Series 6 - 40mm (DFBA664C-E9C3-4B5B-B470-178EB6C2C0CC) (Shutdown)
    Phone: iPhone 12 Pro (6E8B4A8D-09BC-41A8-A31A-41BB8EFB3559) (Shutdown)
C8823103-8456-4BB3-BB72-7E93CD53420D (active, disconnected)
    Watch: Apple Watch Series 6 - 44mm (7A38D648-34DF-4EAF-A227-0A9FE00B1CA6) (Shutdown)
    Phone: iPhone 12 Pro Max (DA36DB0B-FFD2-4716-AC0C-DE7816481EF0) (Shutdown)

For example, to launch iPhone 12 simulator with following command:

$ open -a Simulator --args -CurrentDeviceUIDI 8BF9D420-0911-41BD-840C-8BA319F21CD9

Open Recent Simulator

$ open -a

You also can use the standard Mac application Spotlight Search for typing simulator to startup the simulator, like

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.