Giter Club home page Giter Club logo

android-runner's Introduction

Android Task runner

Automated experiment execution on Android devices

Install

This tool is only tested on Ubuntu, but it should work in other linux distributions. You'll need:

  • Python 2.7
  • Android Debug Bridge (sudo apt install android-tools-adb)
  • Android SDK Tools (sudo apt install monkeyrunner)
  • JDK 8 (NOT JDK 9) (sudo apt install openjdk-8-jre)
  • lxml (sudo apt install python-lxml)

Note: It is important that monkeyrunner shares the same adb the experiment is using. Otherwise, there will be an adb restart and output may be tainted by the notification.

Note 2: You can specifiy the path to ADB and/or Monkeyrunner in the experiment configuration. See the Experiment Configuration section below.

Quick start

To run an experiment, run:

python android_runner your_config.json

There is an example configuration file in example/example_config.json

Structure

devices.json

A JSON config that maps devices names to their ADB ids for easy reference in config files.

Experiment Configuration

Below is a reference to the fields for the experiment configuration. It is not always updated.

adb_path string
Path to ADB. Example path: /opt/platform-tools/adb

monkeyrunner_path string
Path to Monkeyrunner. Example path: /opt/platform-tools/bin/monkeyrunner

type string
Type of the experiment. Can be web or native

replications positive integer
Number of times an experiment is run.

devices Array<String>
The names of devices to use. They will be translated into ids defined in devices.json.

paths Array<String>
The paths to the APKs/URLs to test with.

browsers Array<String>
Dependent on type = web
The names of browser(s) to use. Currently supported values are chrome.

profilers JSON
A JSON object to describe the profilers to be used and their arguments. Below is an example:

  "profilers": {
    "trepn": {
      "sample_interval": 100
    }
  }

scripts JSON
A JSON list of types and paths of scripts to run. Below is an example:

"scripts": {
  "before_experiment": "before_experiment.py",
  "before_run": "before_run.py",
  "interaction": "interaction.py",
  "after_run": "after_run.py",
  "after_experiment": "after_experiment.py"
}

Below are the supported types:

  • before_experiment
    executes once before the first run
  • before_run
    executes before every run
  • interaction
    executes between the start and end of a run
  • after_run
    executes after a run completes
  • after_experiment
    executes once after the last run

Detailed documentation

The original thesis can be found here:
https://drive.google.com/file/d/0B7Fel9yGl5-xc2lEWmNVYkU5d2c/view?usp=sharing

FAQ

Devices have no permissions (udev requires plugdev group membership)

This happens when the user calling adb is not in the plugdev group.

Fix

sudo usermod -aG plugdev $LOGNAME

References

https://developer.android.com/studio/run/device.html
http://www.janosgyerik.com/adding-udev-rules-for-usb-debugging-android-devices/

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.