Opening links on the simulator from the terminal

Marcio Klepacz
1 min readAug 3, 2015

--

A useful tip especially if have to test deep links: You can open them on iOS simulator from the command line using xcrun. Open your terminal and type:

In depth

xcrun allows you to invoke developer tools from the terminal, in this case simctl which is a command line utility to control the iOS Simulator, simctl has the subcommand: openurl to open URLs in a given simulator, most of the cases you would like to open on the current booted device, so you add the flag booted or type the simulator id.

Other stuff you can do with simctl:

create: Create a new device.
delete: Delete a device.
erase: Erase a device’s contents and settings.
boot: Boot a device.
shutdown: Shutdown a device.
rename: Rename a device.
getenv: Print an environment variable from a running device.
openurl: Open a URL in a device.
addphoto: Add photos to the photo library of a device.
install: Install an app on a device.
uninstall: Uninstall an app from a device.
launch: Launch an application by identifier on a device.
spawn: Spawn a process on a device.
list: List available devices, device types, or runtimes.
icloud_sync: Trigger iCloud sync on a device.

--

--