Artemix
Artemix

Reputation: 8655

NSLog not working when debugging an app extension

I just can't see any logs in the window, even though I know I'm attached to the extension, I can place and enter into breakpoints, as well I see the values of variables.

However I can't see any logs.

Any ideas?.

Normal app logs works just fine.

Upvotes: 1

Views: 845

Answers (1)

Aleksander
Aleksander

Reputation: 2815

Seems like you are running the actual main app, not the extension (wrong scheme).

In Xcode, next to the play and stop buttons it should say the name of your app and the device you're running on. Make sure it says the name of your extension, not the name of your actual app.

Please see the attached screenshot:

enter image description here

As you can see, I have selected my keyboard extension - not the main application 'TransKey'. Once you do that, you should be able to see the logs in the Debug area for your extension.

Upvotes: 2

Related Questions