Build an independent watch app - PART IV

In Part I [], we created an app for the typical caveman with an Apple watch. In part II [], we added

3 years ago

Latest Post The Great Escape Tunnel by Mario Esposito public

In Part I, we created an app for the typical caveman with an Apple watch. In part II, we added support for hearing the sound a dino makes. In part III we added pretty icons.

Now, it’s time to deploy that app on the watch so the caveman can go back and hunt for…me!

To deploy on the hardware you will need the following:

Step Zero

Make sure that you watch has the latest and greatest watchOS installed and that the watch app on the iPhone can see the watch and that is currently set as active. In case you have more than one watch and don’t use a dedicated phone/watch combo, this step is important. If you only have one of everything than you are good.

Step One

  1. Open Devices and Simulators
  2. Connect the phone to the computer
  3. Wait for XCode to tell you that your device is ready for development.

Step Two

After staring at such a pretty and amazing UI for the whole 2 nanoseconds. Connect your phone to the computer where XCode is installed. Connecting to your mom’s laptop won’t help if the project is on your dad’s. Just sayin’…

For the entire time of this process do not let the phone lock up otherwise XCODE background daemon won’t be able to finish the job or do the job at all.

Once it all done you won’t get a message that you are ready to go but the yellow banner than XCODE is preparing your device for development will be gone. If you have not been paying attention and you let the device lock, unplug and replug. Exit and re-enter Device and Simulators UI. Tolja!

The watch is discovered as part of the process of connecting the phone. At the end of the setup, flag the “Connect via network” if in future you want to deploy over the air without having to attach the cable. Notice that often doesn’t work over corporate WiFi setups (long story of the why…)

Step Three

Select the watch you are deploying to and hit CMD + R or the button on the toolbar.

You will be asked to register the ID of the device

Cancel is not the button that you want to hit. You know…

Sometimes it fails to register and that could be because something is missing in the keychain, just hit

If that happens, use the “Always Allow” button unless you don’t want to exercise your password typing skills multiple times. Thanks Apple…

After that you should be seeing this

Make sure that you are either wearing the watch or that there’s no lock otherwise you will no be worn and the process will not be continuing.

Step Four

Be patient. Particularly the first time ever doing it as this procedure has NEVER been flawless for the developer. The first watch dev experience was beyond awful, it is getting a little (not much) better release after release but it is obvious that Apple itself isn’t using much their watches as their phones :-)

Step Five

At some point you will see a message on the watch, to trust the connected device.

Hit Trust, unless you don’t want to use the watch. Keep my good eye on you!

Originally posted by gameraboy1

And at this point, if you have done all well, you should be seeing this

That’s, I am out.

Mario Esposito

Published 3 years ago