Logo for tanaschita.com

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:

  1. Select Product > Scheme > Edit Scheme in Xcode's menu.
  2. Select Wait for executable to be launched in the Launch section of the Info tab.
Wait for executable to be launched setting.
Wait for executable to be launched setting in Xcode.
  1. 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.

Image of books
News from tanaschita.com: I'm now offering sponsorship
By publishing a new article on different iOS topics every week, tanaschita.com is constantly growing in the developer community and may provide a great audience for you as a sponsor. Click here to learn more.


Receive a monthly newsletter about the latest articles and tips.

Image of a reading marmot

Related tags

Written by

Articles with related topics

Latest articles and tips