2

Up until today, I've been able to build, run, and debug my watch app and iOS app at the same time. When I build and run, the debugger attaches to the watch automatically. Then I have to manually attach the iOS debugger. I have been following these steps and they always worked perfectly. I can hit breakpoints on both on the watch and the phone (which is what I need to do to be able to debug things like sendMessage or applicationContext).

The problem now is that when I go to attach the iOS app to the debugger manually (via Debug -> Attach to Process), it doesn't show up in the likely targets or in applications at all, even though the app is running on the phone.

I checked my schemes and made sure that the targets were still correct- they are.

I even tried Debug -> Attach to Process with PID or Name. When I try to attach the iOS app by name, I get an error saying Will install Watch App called with bad bundle identifier '(null).

Why is my iOS app no longer a likely target? How can I get it to attach to the debugger again while my watch app is also attached?

Tessa
  • 176
  • 13
  • Have you tried Clean Build Folder (⌥⇧⌘K)? Restarting your Mac? –  Mar 09 '16 at 17:33
  • I had restarted my computer earlier and cleaned the build folder multiple times, but it didn't change anything. Now after restarting and cleaning build folder again, I am getting an error `error: WatchKit App doesn't contain any WatchKit Extensions. Verify that the value of NSExtensionPointIdentifier in your WatchKit Extension's Info.plist is set to com.apple.watchkit.` I checked my Info.plist and it is correct – Tessa Mar 09 '16 at 17:54
  • The issue really isn't about debugging, but a build issue which also happens to affect your app from properly being debugged. If you search for that "WatchKit App doesn't contain any WatchKit Extensions" error, you may discover that one of the suggested fixes helps. You should also [file an Xcode bug report](https://bugreport.apple.com/), especially if you happen to be using beta software, and this broke because of a new tools or OS version. –  Mar 09 '16 at 18:07
  • Same problem for me. Any luck you guys? – Perjan Duro Apr 01 '16 at 08:11
  • @PerjanDuro Nope, I've just been using the simulator to debug both at the same time. It is when I try to use the actual devices that I can't attach the phone :/ – Tessa Apr 01 '16 at 20:26

1 Answers1

0

I use another way to debug on watch app and iPhone app at the same time. I run this script when watch and iPhone simulators are running on my Mac. Then launch my watch app or iPhone app on the same simulators. I can observe both log at the same time.

P.S. These log are come from console, so you should use NSLog(), not print().