This repository contains the code for the system for the paper: LLM-Explorer: Towards Efficient and Affordable LLM-based Exploration for Mobile Apps.
LLM-Explorer is based on DroidBot. By leveraging LLM, the exploration can be more efficient.
Python
Java
Android SDK
- Add
platform_tools
directory in Android SDK toPATH
Then clone this repo and install with pip:
git clone https://github.com/MobileLLM/LLM-Explorer.git
cd LLM-Explorer
pip install -e .
-
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
.
-
Set
GPT_API_URL
andGPT_API_KEY
environment variables to your ChatGPT API url and key instart.py
. -
Start DroidBot with LLM-guided policy:
droidbot -a <path_to_apk> -o output_dir -policy llm_guided
- 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