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.

Sponsorship logo
Capture HTTP(s) traffic with Proxyman
Proxyman - Your ultimate man-in-the-middle proxy to effortlessly capture, inspect, and manipulate HTTP(s) traffic on macOS, Windows, iOS, and Android devices.
Get started for free

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.

Sponsorship logo
Capture HTTP(s) traffic with Proxyman
Proxyman - Your ultimate man-in-the-middle proxy to effortlessly capture, inspect, and manipulate HTTP(s) traffic on macOS, Windows, iOS, and Android devices.
Get started for free

Newsletter

Image of a reading marmot
Subscribe

Like to support my work?

Say hi

Related tags

Articles with related topics

debugging

testing

xcode

ios

How to change a variable's state while debugging an iOS application

Learn to use the expression LLDB command to change application state while debugging.

18 Jul 2022 · 3 min read

Latest articles and tips

© 2023 tanaschita.com

Privacy policy

Impressum