Getting Going with the Apple Watch in Rubymotion

11 October
  • rubymotion, ios, ruby, technical

We’ve been putting an Apple Watch extension to an existing app and it’s been great fun! We were hitting some issues getting going with it in Rubymotion. I thought I’d start to document our findings and hopefully that’ll help others.

So the main thing was that we couldn’t get the app running on our watches in development mode. The Apple Watch Rubymotion guide tells you to set the identifiers but they tell you to set it to something wrong :/. As you probably know, to allow deployment onto you iPhone and Apple Watch, you’ll need to set up identifiers. Here are the identifiers that you need set to in order to deploy successfully:

  • Parent app: com.mycompany.my_app
  • Watch app: com.mycompany.my_app.watchkitapp
  • WatchKit extension: com.mycompany.my_app.watchkitapp.watchkitextension

The 2 Rakefiles need to be set up as described in the guide. Parent app Rakefile provisioning and code-signing info: "my_watch_app", :watchapp
app.codesign_certificate = 'My Codesign Certificate'
app.provisioning_profile = _com.mycompany.my_app.mobileprovision_

Then, the watch app Rakefile provisioning and code-signing info needs to be:

app.codesign_certificate = 'My Codesign Certificate'
app.provisioning_profile = _com.mycompany.my_app.watchkitextension.mobileprovision_
app.watch_app_config.codesign_certificate = 'My Codesign Certificate'
app.watch_app_config.provisioning_profile = _com.mycompany.my_app.watchapp_

I’ll be adding more shortly, so please check back.