Reputation: 3085
I've followed the documentation that Apple provides for debugging extensions and I'm still unable to debug an extension, so for example, breakpoints are not being picked up.
I've created a new target for the extension, that created a new scheme and I've configured that scheme to launch the correct app when running my extension.
The extension works fine but debug things like NSLog or breakpoints are not working. I also tried answers like this but they are not working
I'm using Xcode 6 beta 5 and iOS simulator
Upvotes: 2
Views: 4600
Reputation: 3085
In addition to this answer https://stackoverflow.com/a/24043265/1136433 which says how to view logs of the extension app, in that log you can also check the PID of the extension.
Let's say you have the following NSLog statement:
NSLog(@"Testing");
Execute the extension and in the system.log you will see something like this:
Sep 11 11:13:40 my_machine.local today[5689]: Testing
Where 'today' is the name of the extension you are executing (in my case was a Today Extension) and the '5689' is the extension PID.
So, now you can go to Xcode -> Debug -> Attach to Process and then you can set breakpoints and debug the code.
Hope this can help somebody
Upvotes: 6