Setup Pebble on Linux

The Pebble watches are no more but for those of us who love the old school, these watches are great. Unfortunately, the Pebble dev environment is hard to access. This is how to do it on Linux.

Download the Pebble SDK from here.

Create a folder called pebble-dev/ in your ‘home’ directory.
Change into that directory and extract the Pebble SDK that you just downloaded. If the sdk you downloaded is 4.5 the commands would be:
cd ~/pebble-dev/
tar -jxf ~/Downloads/pebble-sdk-4.5-linux64.tar.bz2

You should now have the directory ~/pebble-dev/pebble-sdk-4.5-linux64 with the SDK files and directories inside it.

Now add the pebble command to your path (so you can run pebble cmds without having to change into the directory where pebble SDK is) by running:
echo ‘export PATH=~/pebble-dev/pebble-sdk-4.5-linux64/bin:$PATH’ >> ~/.bash_profile && . ~/.bash_profile

Now we install pip and virtualenv:
sudo apt-get install python-pip python2.7-dev
sudo pip install virtualenv

Install the Python library dependencies locally by running each of these commands:
cd ~/pebble-dev/pebble-sdk-4.5-linux64
virtualenv –no-site-packages .env
source .env/bin/activate
pip install -r requirements.txt
deactivate

Get emulator dependencies:
sudo apt-get install libsdl1.2debian libfdt1 libpixman-1-0

Install NPM: sudo apt-get install npm

Install the archived SDK using pebble sdk install: https://github.com/aveao/PebbleArchive/raw/master/SDKCores/sdk-core-4.3.tar.bz2

Navigate to ~/.pebble-sdk, and make a blank file inside called NO_TRACKING using:
touch NO_TRACKING
If there is already a file called ENABLE_ANALYTICS in the folder, remove it.

Type into the command line: pebble –version
You should see a response like: Pebble Tool v4.5 (active SDK v4.3)

Your Pebble development environment should now be set up.

Create a new directory and run the following command in the root of the new directory:
pebble new-project hello-pebble
cd to the root of the hello-pebble directory.
Next, run: pebble build
When the code is compiled, you should see the message ‘build’ finished successfully and a number of new files in the build directory.

Pebble uses platform names to differentiate the three generations of Pebble smartwatches.
• Aplite is the platform name for Pebble and Pebble Steel.
• Basalt is the platform name for Pebble Time.
• And Chalk is the platform name for Pebble Time Round.

The run : pebble install –emulator aplite
This command launches the emulator, starts the selected platform, and installs the .pbw file stored in the build directory.

If you want to install the .pbw file to a watch:
pebble install — phone phone ip address