(This is an ongoing work. Repo not ready yet.)
DroidBot-LLM is an LLM-powered test input generator for Android. DroidBot-LLM is based on DroidBot. By leveraging LLM, the generated input can be more intelligent.
Reference
Python
(both 2 and 3 are supported)Java
Android SDK
- Add
platform_tools
directory in Android SDK toPATH
- Set
GPT_API_URL
andGPT_API_KEY
environment variables to your ChatGPT API url and key.
Clone this repo, change directory into the root directory, and install with pip install -e .
. If successfully installed, you should be able to execute droidbot -h
.
Alternatively, you can run without installation using python start.py
in the root directory.
-
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
.
-
Start DroidBot with LLM-guided policy:
droidbot -a <path_to_apk> -o output_dir -policy llm_guided
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 callingadb 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 may find other useful features in
droidbot -h
.
- If you are using multiple devices, you may need to use
-
Start DroidBot with manual policy: go to
start.py
and setos.environ['manual'] = 'True'
droidbot -a <path_to_apk> -o output_dir -policy llm_guided
That's it! You will find much useful information, including the UTG, generated in the output dir.
- The DroidBot Project: DroidBot