(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)JavaAndroid SDK- Add
platform_toolsdirectory in Android SDK toPATH - Set
GPT_API_URLandGPT_API_KEYenvironment 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:
.apkfile 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_guidedThat'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_envoption 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.pyand setos.environ['manual'] = 'True'droidbot -a <path_to_apk> -o output_dir -policy llm_guidedThat's it! You will find much useful information, including the UTG, generated in the output dir.
- The DroidBot Project: DroidBot