When working on a Pebble watch face on OS X, I like to use Xcode as development environment. I like to have autocompletion and the ability to jump to the method definitions. Also, although Xcode does not build the project, it will still show you feedback in the code editor about mistakes you make.
In this short post I will describe how to set up a pebble project with Xcode.
- Create a new project in Xcode of type ‘Command Line Tool’.
Set the type to C and leave ARC checked off. It will create a folder hierarchy, which was in my case: dutch_time/dutch_time.
- Delete the inner folder. (dutch_time/dutch_time, in my case)
- Go in the Terminal and move to the outer folder (dutch_time). This folder should only contain the .xcodeproj file.
- Now create a new Pebble project, which in my case would be something like:
../../PebbleKit-v1.1/Pebble/tools/create_pebble_project.py ../../PebbleKit-v1.1/Pebble/sdk/ dutch_time
- In Xcode, you can now add the source file (dutch_time.c) created by the Pebble script.
- Xcode has created a target for the new project, and although it will not build the .pbw, you can link the project with libpebble.a from the /sdk/lib folder in the PebbleKit sdk.
- In Xcode you also add the headers from your projects /include directory (in my case /dutch_time/dutch_time/include).
When you have followed these steps, you can work with a bit more intelligent code editor on your Pebble project.