Reputation: 5345
I have an issue I am troubleshooting which occurs very infrequently and doesn't seem to happen when I have things running under Xcode.
Is it possible to run an app normally (i.e. from Springboard) until my issue occurs, and then attach a debugger at that point?
I would prefer to do this without jailbreaking if possible.
Upvotes: 120
Views: 96868
Reputation: 19
I was able to debug the app by adding a breakpoint on the AppCoordinator file init()
method on the super.init()
line.
I was able to turn off the wifi/internet and then by pass the developer verification.
Upvotes: -1
Reputation: 135540
Debug navigator
when started via Xcode (e.g. Target's name not bundle-id).If the app is already running, the debugger will attach to the running process. If it isn't running, it will wait for the app to launch and then attach.
Upvotes: 153
Reputation: 23542
In Xcode 5.0.1 and 6 it's the menu bar items:
Debug > Attach to Process > By Process Identifier (PID) or Name...
Upvotes: 49
Reputation: 36333
I'll leave this here since neither of the other 2 answers gave me quite enough detail without a little bit of a struggle.
Run your app in the simulator and take note of the name in the Debug navigator
Plug in your device and don't forget to select your device as the target
Upvotes: 129