- (void)viewDidLoad
{
NSLog(@"%s", __func__);
// ...
}
in viewDidLoad
of an iOS 8 extension. the NSLog
outputs nothing in Xcode. NSLog
works as usual in the container app though.
How can I get output from debug messages from an extension?
Steps to debug an app extension:
Run the container app. In this step, Xcode uploads the container app and app extension to the device or simulator.
Stop the container app. This step is important when you debug in simulator. If you don't do it, Xcode will tell you the simulator is in use.
In Xcode, press menu Debug -> Attach to Process -> By Process Identifer (PID) or Name..., input the app ext's identifier, e.g. com.abc.ContainerApp.MyExtension, to start debugging. Don't forget to set break points. (Update on Aug 25, 2014: you can input MyExtension(your extension's name) directly.)
In the device or simulator, open your app extension.
I found the debugging steps above do not work well on Xcode 6 beta 6 with iOS 8 SDK beta 5 on the simulator.
Solution:
The breakpoints work. But I don't know why logs do not show in the output window.