Skip to content

Instantly share code, notes, and snippets.

@MMnasrabadi
Last active October 14, 2020 11:51
Show Gist options
  • Save MMnasrabadi/645b2e1c076e28a2417eb0829959bda9 to your computer and use it in GitHub Desktop.
Save MMnasrabadi/645b2e1c076e28a2417eb0829959bda9 to your computer and use it in GitHub Desktop.
To open a custom URL scheme (or any website) in a simulator.
xcrun is a tool to run any tool inside Xcode from the command line. The tool for this job is simctl, which help you manage simulators.
@MMnasrabadi
Copy link
Author

xcrun is a tool to run any tool inside Xcode from the command line. The tool for this job is simctl, which help you manage simulators.

To open a custom URL scheme (or any website) in a simulator.

Run your app in the Simulator.
Open Terminal.app (located in /Applications/Utilities)
Enter the following command and hit ⏎ Return.

xcrun simctl openurl booted <url>

Example

xcrun simctl openurl booted acme://test

This will simulate what we used to do in Safari, but a lot easier and faster.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment