Debugging iOS features that require restarting the app in Xcode
Quick tip on how to debug features like deep linking or home screen quick actions.
11 Apr 2022 · 2 min read
When running an iOS application in Xcode, the debugger automatically attaches so we can use tools like break points or console outputs. When we kill the application from a simulator or device, Xcode automatically detaches the debugger.
In some cases though, we want the debugger to stay attached to be able to test features like deep linking or home screen quick actions from a state where the app is launched.

For these cases, Xcode provides a scheme setting Wait for executable to be launched. To activate it:
- Select Product > Scheme > Edit Scheme in Xcode's menu.
- Select Wait for executable to be launched in the Launch section of the Info tab.

- Run the app. This time, the app won't automatically launch but Xcode will wait for us to launch it manually.
After following the steps above, we can start testing the feature, for example tap on a deep link or choose a home screen quick action. As soon as the app launches, Xcode will automatically attach the debugger.

Newsletter
Like to support my work?
Say hi
Related tags
Articles with related topics
Latest articles and tips