Overview

This page describes the process of downloading and running JPF-Android. JPF-Android has quite a few dependencies and therefore is downloaded and setup using a docker container. This container is a development environment used to build Android apps and JPF projects and to run Android apps using JPF-Android.

The JPF-Android Docker container

The repository below contains the Dockerfile and folders to build an image containing:

  • Official Ubuntu 14.04
  • Official Oracle Java 1.8
  • Ant 1.9.8
  • JUnit4
  • Android
    • tools
    • build-tools
    • platform-tools
    • targets 10 15 and 19 (without emulator)
  • python2.7 + pip (for logparser)
  • vim
  • git
  • mercurial
  • mongo 3.0
    • mongo client
    • mongo tools

The docker image can be built by cloning the repository and running "docker build".

git clone https://bitbucket.org/heila/jpf-android-docker.git
docker build -t jpf-android

The built image is around 1.3 GB in size.

Alternatively the docker image can be downloaded from Dockerhub:

docker pull heila/jpf-android

External Volumes

Directories on the host can be mounted in the container at runtime. These volumes are then used to persist JPF-Android projects, apps and the results.

  • /JPF - containing JPF projects
  • /APPS - containing apps and jpf-android-examples
  • /RESULTS - stores the results

LinkingMongoDB

A mongodb docker can be linked (optional) when runtime values are used. If the JPF projects, apps and mongodb content has not been setup the user can run `./setup.sh` in the docker's terminal to download and build the projects and insert the mongodb content.

# start mongodb with data persisted in data/db 
mkdir -p data/db 
docker run -v data/db:/data/db -p 27017:27017 --name mongodb3 -d mongo:3.0 

Running

The docker runs as an interactive terminal giving the user a terminal back when docker run is called. `--rm` removes the docker container and its file system after the terminal session is closed. The setup.sh script in the root of the container downloads, updates and builds all projects and apps in JPF and APPs directory. The results of runs are stored in the RESULTS directory on the host (if linked using a volume).

# setup JPF-Android folder structure 
mkdir APPS 
mkdir JPF 
mkdir RESULTS 

# Create a JPF-Android container 
docker run --rm -v JPF:/JPF -v APPS:/APPS -v RESULTS:/RESULTS --link mongodb3:mongo -it jpf-android 

# setup code base / pull latest changes and build workspace
root@652f10eb3ae4: chmod +x setup.sh 
root@652f10eb3ae4: ./setup.sh 
root@652f10eb3ae4: mongoimport --host=mongodb3 --port=27017 --db events_db --collection events --file events_exported.json 

# run jpf-android-examples cd jpf-android-examples
root@652f10eb3ae4: cd /APPS/jpf-android-examples
root@652f10eb3ae4: ./run.sh Calculator +event.strategy=default          

Using Eclipse to edit JPF-Android

To edit jpf-android import the projects in the "JPF" directory and "APPS/jpf-android-examples" directory on the host into Eclipse.