Saturday, 25 April 2015

Hello World WatchKit app "occasionally" works in Simulator

Finally installed Yosemite, and upgraded to XCode 6.3, first thing I tried was to create a WatchKit app using "File => New => Project..." menu options. But I couldn't find the option for Apple Watch and was a bit confused at the first.

Later looked at the Natasha The Robot "Hello World" tutorial, then realised the option is only available after you created the new projects, then select "File => New => Target..." menu option, since at this stage it's not native app yet and can only be treated as an external display like the Apple TV.

After staring at the black box for a long time plus a few restarts, finally got the simple Hello World WatchKit app working in iPhone 6 Simulator as shown below. 

It's definitely not a smooth ride. Sometimes I get this "MobileCal quit unexpectedly" error

Sometimes I get this "Lost connection to iPhone 6" message. And most of the time it's just a black box sitting there, staring back at me...

If I click on the "WatchTest" icon manually to run it from inside the simulator, it just starts up, show a blank screen with white background and nothing happened. Later, noticed I can also run the "Apple watch" app inside the iPhone 6 simulator. 

As shown below, it shows the Hello World WatchKit app name in the "WatchKitSettings" table. This is probably done through the built-in WatchKit, which links the app with the "Apple Watch" app on the iPhone 6 simulator.

Clicked on the "WatchTest" icon and it shows the option of "Show App on Apple Watch" turned on by default, which I believe may be it should be on all the time for the output to be displayed on the watch properly?

Tried turning it off just for fun, and another line saying "GIZMO_APP_UNINSTALLING", wonder what does that mean...

Turned it on again, and the text changed to "GIZMO_APP_INSTALLING".

Not sure if everyone is having better/worse experience than me, from the comments on Natasha's blog, looks like quite a lot of them are unsuccessful - only a black box... My advice will be: (1) wait for 3-5 min, (2) try "Product => Clean" and try again (3) try shut down and restart the simulator.

I guess similar to Swift, WatchKit is probably still in it's early stage and not very matured yet based on my experience. May be should wait for next 2-3 updates?

Wait, just noticed Xcode 6.3.1 been released, will upgrade and see if this makes any difference.

No comments:

Post a Comment