How to connect a debugger to an iOS application after launch?

I have a problem. Troubleshooting is very rare and doesn't seem to happen when I have things running under Xcode.

Is it possible to run the application normally (i.e. from Springboard) until there is a problem, and then attach the debugger at this point?

I would prefer to do it without jailbreak, if possible.

+95
debugging ios xcode
Mar 15 2018-12-12T00:
source share
4 answers
  • Connect the device connected to your Mac
  • With older versions of Xcode:

    Product β†’ Attach to Process β†’ By Process Identifier (PID) or Name ...

    with version 7. 2+ (checked on 9.2):

    Debugging β†’ Attach to process by PID or name

  • In the dialog box, enter the name of your application, which is displayed in the debug navigator when starting through Xcode.

If the application is already running, the debugger will connect to the running process. If it is not running, it will wait for the application to start, and then connect.

+113
Mar 15 2018-12-15T00:
source share

I will leave it here, since none of the two answers gave me enough details without any struggle.

  • Run the application in the simulator and pay attention to its name in the debug navigator enter image description here

  • Connect the device and do not forget to select the device as the target enter image description here

  • Debug> Bind to Process> Process Identifier (PID) or Name enter image description here
  • Enter the name from step 1 and attach. That should be all you need. enter image description here
+108
Jan 14 '15 at 2:35
source share

In Xcode 5.0.1 and 6, it is in

Debug > Attach to Process > By Process Identifier (PID) or Name... in Xcode 
+48
Nov 25 '13 at 12:27
source share

In Xcode 7, this is simple:

 Debug > Attach to Process by PID or Name... 
+7
Jun 09 '16 at 17:27
source share



All Articles