0

I am not able to launch my app on my iphone device and debugg. That is, my debugger does not get attached when I am using my device for debugging. How do I enable that?

The error states could not attach to process...

how do I enable debugger for xcode8 for my device? It is an iPhone iOS 10

Ackman
  • 1,562
  • 6
  • 31
  • 54
  • Have you tried disconnecting and reconnecting the device/quitting and re-starting Xcode, etc.? i.e.: Are you sure this isn't a temporary issue? – John Parker Dec 17 '16 at 19:55
  • Yes. That does not work. – Ackman Dec 17 '16 at 20:00
  • And you've restarted both the device and the machine? – John Parker Dec 17 '16 at 20:00
  • Yes. I have tried all of this. Is there a schem or something I have to enable or perhaps change lldb to gdb or something else. Where do you have the debugger functionality in xCode? – Ackman Dec 17 '16 at 20:02
  • If you can't attach to the process you're not going to be able to debug anything. When you look at the available devices (via the "Window -> Devices" option in Xcode) does it show the device as being connected, etc.? Also, I presume debugging works correctly using the simulator? – John Parker Dec 17 '16 at 20:05
  • Yes It does. I perhaps need to edit the scheme? – Ackman Dec 17 '16 at 20:08
  • process launch failed: failed to get the task for... – Ackman Dec 17 '16 at 20:23
  • @Ackman whats the `error` reports ? please post the error in your question. – aircraft Dec 18 '16 at 02:47

1 Answers1

1

If you are getting the "failed to get the task for pid" error, that means that your app does now allow itself to be debugged. On iOS, by default, the debugger is NOT allowed to attach to an iOS app. When you build the debug configuration of your app, Xcode automatically adds the correct entitlement, and the debugger is allowed to attach. The release configuration typically does not add this entitlement, so you generally can't attach to release builds.

For more info on this entitlement, see for instance:

What does get-task-allow do in Xcode?

Without looking at your project it's hard to know what has gone wrong, but this might give you a place to start looking.

Community
  • 1
  • 1
Jim Ingham
  • 25,260
  • 2
  • 55
  • 63