Can anyone run watchOS2 beta 3 apps on the watch device while debugging with Xcode?

I just don't seem to be able to debug an app if it is running on the actual watch. I am on beta 3 and this is what happens:

  1. Xcode takes a while to detect the watch.
  2. if I try to run the watchkit app scheme (real device + paired real watch), the app installs to both devices, then Xcode beachballs a little and the it says it's done running on the watch.
  3. if instead I run the iOS app scheme first and then the watchkit app one, again Xcode beachballs a bit and then the iOS app crashes (a sigkill LOL). ie.:
0x10004ec74 <+120>: bl     0x10004ed08; symbol stub for: UIApplicationMain
0x10004ec78 <+124>: stur   w0, [x29, #-4] <<-- SIGKILL


This is not that different than what I was experiencing with beta 2, but for the crash. With beta 2 it would also beachball and then finish without running or seemengly attaching to the debugger. BTW, once the app has been pushed by Xcode into the phone and from the phone to the watch, the watch app itself runs just fine if I don't attempt debugging. So my question is basically about how am I supposed to be able to debug watch apps running on the watch with Xcode.


Thanks!

I filed radar 21783061 detailing this problem. I'm seeing the same thing.

I wonder why there aren't more people chiming in here. I wonder if I just got a bad watch or what, cause otherwise I have no idea how others are being able to develop anything. I mean at least for me the thing is imposible to work with. All I can do is write the code, upload to the watch and "test" as if it were a black box, merely guessing if things are working or not by observing the watch app running itself as a user :/


I've even gotten to the point that I debug in morse code of sorts with the haptic engine lol. As in, say I have a method that has success and failure callbacks: I put one haptic pattern in the success and another in the failure... so sad.

I keep wondering the same thing. Maybe everyone is doing what I've decided to do - try each beta and if it is as bad as the previous one, work on other projects until the next beta comes out. With Beta3, I can do some work on the simulator with some regularity (a few random Xcode or Simulator crashes here and there). When I need to run on the watch, I have an eight step process that usually gives me one good run:


1. Delete the app from the iPhone and wait for it to remove it from the watch.

2. Power down the watch and iPhone. Close Xcode completely.

3. Power up the watch and iPhone. Wait until they are both up and running.

4. Start Xcode and wait until the watch shows as paired. You can speed that up by rearranging icons in the watch app on the phone.

5. Run the watch app and wait maybe 5 minutes.

6. If step 5 fails to work, repeat step 5 several times.

7. If still no luck, start at step 1 again.

8. If several tries fail, work on something else until the next beta comes out.

+1 I can't debug or even run any of our app extensions on the watch in beta 3. Still pulling my hair out trying everything I can to run. Not only can I not debug them, they will never actually launch. I have created simple new projects to make sure it's not just our apps. Nothing will launch that is built through Xcode.

Filed 21800968.

I can't debug on real Watch, but I can still launch the app... After deploying the app on the Watch, you need to reboot the Watch. Next time running, the app will be able to run. Hope that helps.

You should still be able to develop that on Simulator though.

Update: I can run (not debug) every time on the watch by installing an ad hoc distribution through iTunes.

  1. Product -> Archive [You may have some code signing issues to figure out here--especially if you have multiple people who sign the builds for your organization.]
  2. Export... -> for Ad Hoc Distribution
  3. Uninstall the app from your iPhone.
  4. Drop the ipa file onto iTunes.
  5. Select your iPhone in iTunes, go to the Apps tab, and find the app you just dropped in.
  6. Click install.
  7. Click apply.
  8. Make sure that "Show App on Apple Watch" is selected in the Apple Watch app, and wait for it to install.

It should run at least. I wasn't abble to attach the debugger to the processes, but I was able to see the performance of the changes that I had already tested on the simulator.


The good news is that performance of button and table responsiveness is probably 10x that of beta 2 if you have lots of buttons. It was tough to get it to run, but I feel like there was a treasure at the end of the hunt. 🙂

I managed to get debugging to work after doing the steps below:


I have found a solution to this:

1. Run app on device from xcode. Wait for loading daisy on watch

2. Force quit app. (Hold friends button until power options displays, then hold friends button again until app closes.)

3. Stop debugging on xcode

4. exit xcode (do not reboot/restart xcode)

5. run app on watch. It should run now.

6. if this does not work start from step 1 again.


Then after the app is running on watch, start up xcode and relaunch app while the app is opened.

The spinning icon will show for a long time, about 10mins or so

It will then connect and debugging will work fine for a while. (Changing code and redeploying but you will still have to wait for 10 min each time)

If after 10 mins it does connect, follow the steps from step 1 above.

Can anyone run watchOS2 beta 3 apps on the watch device while debugging with Xcode?
 
 
Q