- Debugging works for app extensions.
- It works on simulator too.
- If your app ext crashes in the simulator, you may find it is not easy to restart your app ext. Restarting your simulator is a quick solution.
-
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.
-
Updates on Aug 23, 2014:
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:
- Run your extension in the simulator.
- Xcode menu Debug -> Attach to Process -> Choose “MyExtension(your extension’s name)” in System section in the menu.
The breakpoints work. But I don’t know why logs do not show in the output window.