Git Product home page Git Product logo

docker-pebble-dev's Introduction

Pebble development environment

Legal Note

You must accept the Pebble Terms of Use and the SDK License Agreement to use the Pebble SDK.

Note

With the Pebble Tool 4.0 and above it is possible to switch the SDK version on the fly. Based on this change this image will not download an SDK in the build process.

Before you start

To build a pebble APP you must first download a SDK.

If you want to use the image as terminal simply run pebble sdk install <SDK_VERSION> before the first build.

If you want to build direct the build command must be extended like: app with (yes will automatically accept the license):

docker run --rm -it \
    -v ~/pebble-dev/project/:/pebble/ \
    bboehmke/pebble-dev \
    /bin/sh -c 'yes | pebble sdk install <SDK_VERSION> && pebble build'

If you want to keep the SDK mount a volume for /home/pebble/.pebble-sdk/SDKs. Than you load the SDK once and reuse it for the next container. Load the SDK:

docker run --rm -it \
    -v ~/pebble-dev/SDKs/:/home/pebble/.pebble-sdk/SDKs/ \
    bboehmke/pebble-dev \
    pebble sdk install <SDK_VERSION>

Build the APP:

docker run --rm -it \
    -v ~/pebble-dev/project/:/pebble/ \
    -v ~/pebble-dev/SDKs/:/home/pebble/.pebble-sdk/SDKs/ \
    bboehmke/pebble-dev \
    pebble build

If you have multiple SDK you must switch to the correct one before build:

docker run --rm -it \
    -v ~/pebble-dev/SDKs/:/home/pebble/.pebble-sdk/SDKs/ \
    bboehmke/pebble-dev \
    pebble sdk activate <SDK_VERSION>

Usage as terminal

For example if you created a directory pebble-dev in your home directory you start the container with:

docker run --rm -it -v ~/pebble-dev/:/pebble/ bboehmke/pebble-dev

This opens a shell where you can use the pebble command. The actual directory is already /pebble/ (or the host dir ~/pebble-dev/). If you close the session, the docker container is removed.

If you want to reuse the container you should start it with:

docker run --name=pebbleDev -it -v ~/pebble-dev/:/pebble/ bboehmke/pebble-dev

After you close the shell and the container exit, you can use the restart the container with:

docker start -it -a pebbleDev

Direct usage

If you have created a project in ~/pebble-dev/project you can build the app with:

docker run --rm -it -v ~/pebble-dev/project/:/pebble/ bboehmke/pebble-dev pebble build

If the app should be installed after build you can achieve this with:

docker run --rm -it \
    -v ~/pebble-dev/project/:/pebble/ \
    bboehmke/pebble-dev \
    sh -c 'pebble build && pebble install --phone=192.168.2.124'

This works if the phone has the IP address '192.168.2.124'.

Emulator

To use the emulator, you have to add -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix. Start the container with:

docker run -it --rm \
    -e DISPLAY=$DISPLAY \
    -v /tmp/.X11-unix:/tmp/.X11-unix \
    -v ~/pebble-dev/:/pebble/ \
    bboehmke/pebble-dev

If the XServer on the host system only allow valid user (e.g. Arch Linux), you have to add -v ~/.Xauthority:/home/pebble/.Xauthority --net=host:

docker run -it --rm \
    --net=host \
    -e DISPLAY=$DISPLAY \
    -v /tmp/.X11-unix:/tmp/.X11-unix \
    -v ~/pebble-dev/:/pebble/ \
    -v ~/.Xauthority:/home/pebble/.Xauthority \
    bboehmke/pebble-dev

docker-pebble-dev's People

Contributors

bboehmke avatar gibald avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.