Quick way to open a Custom URL Scheme in iOS Simulator
Table of Contents
In the past, the way I test a custom URL scheme is to go to Safari and type in any of my custom URLs in the address bar.
This method works, but it is a bit cumbersome. Safari doesn't remember the last custom URL, that's mean you have to type it again and again. And going back and forth between your app and Safari makes things worst.
You can easily support sarunw.com by checking out this sponsor.
AI Grammar: Correct grammar, spell check, check punctuation, and parphrase.
A better alternative
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.
Read more article about Simulator, Development, or see all available topic
Enjoy the read?
If you enjoy this article, you can subscribe to the weekly newsletter.
Every Friday, you'll get a quick recap of all articles and tips posted on this site. No strings attached. Unsubscribe anytime.
Feel free to follow me on Twitter and ask your questions related to this post. Thanks for reading and see you next time.
If you enjoy my writing, please check out my Patreon https://www.patreon.com/sarunw and become my supporter. Sharing the article is also greatly appreciated.
Become a patron Buy me a coffee Tweet ShareHow to renew an expired certificate with Fastlane Match
Fastlane Match saves us a lot of time managing certificates and provisioning profiles, but there is one thing that we have to do it manually. That is a renewal expired certificate. Luckily, we have to do it once a year. Let's learn how to do it.
Move your view around with Drag Gesture in SwiftUI
SwiftUI's UIPanGestureRecognizer equivalent.