Giter Site home page Giter Site logo

chaxiu / droidbot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from honeynet/droidbot

0.0 2.0 0.0 58.12 MB

A lightweight test input generator for Android. Similar to Monkey, but with more intelligence and cool features!

License: MIT License

Python 95.09% HTML 1.00% CSS 0.14% JavaScript 3.77%

droidbot's Introduction

DroidBot UTG

DroidBot

About

DroidBot is a lightweight test input generator for Android. It can send random or scripted input events to an Android app, achieve higher test coverage more quickly, and generate a UI transition graph (UTG) after testing.

A sample UTG is shown here.

DroidBot has the following advantages as compared with other input generators:

  1. It does not require system modification or app instrumentation;
  2. Events are based on a GUI model (instead of random);
  3. It is programmable (can customize input for certain UI);
  4. It can produce UI structures and method traces for analysis.

Reference

Li, Yuanchun, et al. "DroidBot: a lightweight UI-guided test input generator for Android." In Proceedings of the 39th International Conference on Software Engineering Companion (ICSE-C '17). Buenos Aires, Argentina, 2017.

Prerequisite

  1. Python version 2.7
  2. Java version 1.7
  3. Android SDK
  4. Add platform_tools directory in Android SDK to PATH
  5. (Optional) OpenCV-Python if you want to run DroidBot in cv mode.

How to install

Clone this repo and intall with pip:

git clone https://github.com/honeynet/droidbot.git
cd droidbot/
pip install -e .

If successfully installed, you should be able to execute droidbot -h.

How to use

  1. Make sure you have:

    • .apk file path of the app you want to analyze.
    • A device or an emulator connected to your host machine via adb.
  2. Start DroidBot:

    droidbot -a <path_to_apk> -o output_dir
    

    That's it! You will find much useful information, including the UTG, generated in the output dir.

    • If you are using multiple devices, you may need to use -d <device_serial> to specify the target device. The easiest way to determine a device's serial number is calling adb devices.
    • On some devices, you may need to manually turn on accessibility service for DroidBot (required by DroidBot to get current view hierarchy).
    • If you want to test a large scale of apps, you may want to add -keep_env option to avoid re-installing the test environment every time.
    • You can also use a json-format script to customize input for certain states. Here are some script samples. Simply use -script <path_to_script.json> to use DroidBot with a script.
    • If your apps do not support getting views through Accessibility (e.g., most games based on Cocos2d, Unity3d), you may find -cv option helpful.
    • You may find other useful features in droidbot -h.

Evaluation

We have conducted several experiments to evaluate DroidBot by testing apps with DroidBot and Monkey. The results can be found at DroidBot Posts. A sample evaluation report can be found here.

Acknowledgement

  1. AndroidViewClient
  2. Androguard
  3. The Honeynet project
  4. Google Summer of Code

Useful links

droidbot's People

Contributors

yuanchun-li avatar yzygitzh avatar nastya avatar hannol avatar miniminyi avatar adepasquale avatar saumopal97 avatar ddlucad96 avatar

Watchers

James Cloos avatar BoyCoder 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.