Setting up a Pebble simulator in 64 bit Linux (Mint/Ubuntu)

One reason I bought a Pebble watch was to develop apps for it, so when I put my online order I didn’t want to wait two or three weeks for my watch to arrive before I could start to write code. So I looked for a Pebble simulator online and I found one, PebbleLocalSim. Unfortunately, there were some hurdles to overcome before the Hello World app would run on my machine (Linux Mint 17, 64 bit), and I thought I would share my way to a working simulated Pebble environment.

1. Install the Pebble SDK
Of course, in order to do anything I had to install the Pebble SDK, so I followed the instructions here:
https://developer.getpebble.com/2/getting-started/

2. Build Hello World
I made sure my build environment worked correctly by building the Hello World app, as explained here, but I skipped the installation part since I had no actual watch:
https://developer.getpebble.com/2/getting-started/hello-world/

3. Get the simulator
I got the simulator by downloading the zip-file from here, but a git clone would probably have worked just as well:
https://github.com/Helco/PebbleLocalSim

4. Setup the simulator for my Hello World app
The readme file of the simulator said to copy some files into the installed Pebble SDK and since no files would be overwritten I went ahead and did just that. I copied all files and directories from the zipfile path:
./build/linux/build/bin
to the Pebble SDK path:
(PebbleSDK)/bin

The readme file also asked me to install some files, namely:
sudo apt-get install libsdl1.2-dev libsdl-image1.2-dev libsdl-ttf2.0-dev
I did this but soon trouble would show its ugly face anyway.

5. Try compiling Hello World for the simulator
I changed directory to my Hello World project and tried to build it as a simulated Pebble app:
cd (project)
build.local.sh
… and the compilation failed:

6. Fixing first problem
Some searching on the Internet made me realize that I needed the 32 bit version of the files above, and since I run 64 bit Linux I didn’t install them just then. So I solved that by installing them correctly this time, like this:
sudo apt-get install libsdl1.2-dev:i386 libsdl-image1.2-dev:i386 libsdl-ttf2.0-dev:i386

7. Try compiling again
Then I compiled again and another compilation error appeared.

8. Fixing second problem
Another search on the Internet gave me that I needed a 32 bit version of the compiler as well, which I installed like this:
sudo apt-get install gcc-multilib

9. Building the app
Finally I was able to build the app, and I ignored the warning:

10. Running the app
So, in the end I was able to run the app in the simulator (and I ignored the messages outputted in runtime):
cd (project)
run.local.sh

 

Hello World in Pebble Local Simulator
Hello World in Pebble Local Simulator

And finally I was set up to do some serious Pebble programming.

-.-

Leave a Reply

Close Menu