pebble
  • Tutorials
  • Get the SDK
  • Guides
  • Documentation
  • Examples
  • Community
  • Blog
  • More
Privacy
Cookies
Publish
Get Updates
Follow Us
Subscribe to the Newsletter

Pebble Smartwatch Emulator in CloudPebble!

  • 22 January 2015
  • Katharine Berry
  • CloudPebble, Freshly Baked
  • Comments

We're thrilled to announce the latest addition to CloudPebble: a Pebble smartwatch emulator!

Love Weather running in CloudPebble

To use the emulator, just head over to CloudPebble and run your project. The emulator is now used by default; to install to your phone, change tabs from the Compilation pane:

Phone / Emulator pane

The emulator supports running both strictly native apps and those with a PebbleKit JS component, including Pebble.js apps.

To interact with the emulator, click on the buttons on the sides, or click in the screen and then use the arrow keys for the buttons. In keyboard mode you can also press X, Y, or Z for a tap in the positive direction, or shift-X, shift-Y, or shift-Z for a tap in the negative direction.

You can also adjust the battery state using the settings popover:

Settings popover

This pane also lets you shut down the emulated Pebble smartwatch and open your app's configuration page if it has one. However, you will have to make a minor adjustment to your configuration page: you will be passed a query parameter called return_to; if you're passed that, you should use it in place of pebblejs://close#.

For instance, something like this:

// Something like this to get query variables.
function getQueryParam(variable, default_) {
    var query = location.search.substring(1);
    var vars = query.split('&');
    for (var i = 0; i < vars.length; i++) {
        var pair = vars[i].split('=');
        if (pair[0] == variable)
            return decodeURIComponent(pair[1]);
    }
    return default_ || false;
}

var return_to = getQueryParam('return_to', 'pebblejs://close#');
document.location = return_to + encodeURIComponent(JSON.stringify(some_settings));

We hope this makes developing for the Pebble smartwatch easier than ever! Please let us know if it doesn't work with your app.

Finally, for those who are interested, we'll have some technical posts soon about how we made this work!


You need JavaScript enabled to read and post comments.
Get Updates
Follow Us
Subscribe to the Newsletter

Categories

  • All Posts
  • #makeawesomehappen
  • At the Pub
  • Beautiful Code
  • CloudPebble
  • Down the Rabbit Hole
  • Freshly Baked
  • Timeline

Authors

  • Thomas Sarlandie
  • Niharika Bedekar
  • Jon Barlow
  • Katharine Berry
  • Cherie Williams
  • Chris Lewis
  • Team Pebble
  • Cat Haines
  • Katherine McAuliffe
  • Alex Lin
  • Alexey Komissarouk
  • Brad Murray
  • Kirby Kohlmorgen
  • Ryan Case
  • Ryan Perry-Nguyen
  • Tom Maremaa
  • Meiguro
  • Keegan Lillo
  • Ɓukasz Zalewski

Subscribe to the Pebble Developers Newsletter