How to use Xcode debugging tools on a cold app start

Have you ever struggled with debugging functionality in your app during app launch? Perhaps you are testing deep links or some other form of launching your app that doesn't involve Xcode launching it and wished you could set a breakpoint to look at what is going on under the hood. This is often time consuming to build and test without Xcode's debugging tools.

The struggle is over! Here is how you can make Xcode automatically attach to your iOS app for debugging purposes:

Select Attach to Process by PID or Name... from Xcode's Debug 

Xcode includes this useful function in the Debug menu named Attach to Process. This presents a dialog that enables you to tell Xcode to wait for your app's process to to start running.

Start typing your app's process name and then click Attach

Launch your app by clicking on its, triggering a deep link, etc. and Xcode will automatically attach to its process and enable the debugger. Now, you can set breakpoints, debug the view hierarchy, and more using Xcode's debugging tools 🎉

Show Comments