I would like to find an easier way to call deep links in the iOS simulator.
On Android you can use ADB to pipe links into the simulator by using the console.
Is there a similar way or a workaround to open deep links with the latest iOS Simulator?
I would like to find an easier way to call deep links in the iOS simulator.
On Android you can use ADB to pipe links into the simulator by using the console.
Is there a similar way or a workaround to open deep links with the latest iOS Simulator?
You can type this into your Terminal :
xcrun simctl openurl booted '<INSERT_URL_HERE>'
You can even share documents using the builtin Share Extension from the Finder to the iOS Simulator.
Here's another approach:
In the Simulator
Pro tip: You can add custom labels to the URL entries, for example if you want to test different URLs and be able to identify them quickly.
Note: If you reset the Simulator, the Contacts app will be reset to default and lose the URL.
As an alternative, you can use ControlRoom open-source tool. Basically it's a wrapper above simulator cli.
Unfortunately, the xcrun simctl openurl booted
command didn't work. My link is something like this:
myapp://?p=abc&case=12345
I kept seeing the error of:
MyApp % zsh: no matches found: myapp://?p
I was able to fix it by:
And that's it!
Even though there are a lot of great solutions, I still want to add my 5 cents :)
My approach is based on Automator macOS app and lets you execute any deeplink from your computer on iOS simulator with two clicks.
I’m going to use Quick Actions since in that case, we can use any application to get URLs from. So, start the app, File —> New —> Quick Action —> Choose
. Now drag and drop your first action. It’s going to be Set Value of Variable
. Go to the View
menu and select Variables
. Inside variables section make the right-click and select New variable
. Name it something like url
. We are going to keep input text (which is supposed to be our deeplink) in that variable. Now drag and drop Run Shell Script
action, make sure that Pass
input parameter set to “as arguments”. Paste the following line:
xcrun simctl openurl booted $1
where $1 is going to be our URL variable.
This is how it should look like:
Now save this action as Open in Simulator
. This action is now available in the Services
context menu. Select any URL as a text in any app, right-click, Open in Simulator
- neat right?
(Tested for Branch.io QuickLinks)
Another very simple method of opening deeplinks in iOS simulator is: