Printing to the console with application extension

I play with the new API for keyboard apps in iOS 8, using Swift as my language of choice. However, one thing I noticed is that printlnit seems to never output any output to the console, apparently because these statements are executed in the application, and not in the containing application. Has anyone found a way to print console applications from within the app extension?

+4
source share
2 answers

The most reliable choice is to use NSLogfor debugging purposes, but printlnmay work in this case. You just need to attach the Xcode debugger to the extension itself.

In my experience, this is a pretty bad process. This answer contains additional information on this. In short, you need to change the goal in the Run drop-down list before your extension, and then, after clicking the Run button, you should get a list of things that you can run it on.

+6
source

Like iOS 10, extensions are not registered in the console by default. To enable console logging for your extension:

  • Select an extension target in the Xcode popup
  • a > a > ( Cmd <)
  • "" : OS_ACTIVITY_MODE : disable
0

Source: https://habr.com/ru/post/1546498/


All Articles