Automation of Android Project Building with LLMs
Project description
BuilDroid
⚡ Clone, build, and generate debugging APKs for Android projects using LLM-powered automation.
BuilDroid is a Python package that leverages Large Language Models (LLMs) to automatically clone any Android project hosted on GitHub, configure it, and build the debugging .apk file. This enables faster evaluation, performance testing, reverse engineering, or security analysis of Android applications. The building process happens in an isolated Docker container.
🚀 Features
- 🔗 Clone any Android GitHub repository.
- ⚙️ Auto-configure Gradle build for debugging.
- 🤖 LLM-guided build troubleshooting and error recovery.
- 📦 Outputs ready-to-install debugging APK.
- 🧪 Supports workflows for performance evaluation and static/dynamic analysis.
📦 Installation
pip install buildroid
📦 Dev Container Setup
To setup in a VSCode Dev Container:
- Install the Dev Containers extension.
- Clone this repository.
- Open the repository in VSCode, and it will prompt you to reopen in the dev container. Alternatively, use a command to open the current folder in a dev container.
✅ Requirements
- Python 3.10+
- Git installed and accessible from terminal
- OpenAI API key (or other LLM provider) for LLM access.
⚙️ LLM Configuration
builDroid uses an LLM backend for build assistance. To use it:
- Obtain your API key from OpenAI or compatible provider.
- Set your API key as a .env file:
API_KEY=<your-api-key-here>
BASE_URL=<your-base-url-here>
LLM_MODEL=<your-llm-model-here>
BASE_URL and LLM_MODEL are optional. If not provided, builDroid will use OpenAI's gpt-4.1-mini-2025-04-14.
For example, if you put 'https://generativelanguage.googleapis.com/v1beta/' as your base url, builDroid will access Google AI's gemini-2.0-flash-lite.
If you want to use other providers, you have to provide the base url and the LLM model in .env.
- (Optional) builDroid's primary goal is to successfully execute
./gradlew assembleDebug. To change its goals, create aai_settings.yamlfile in the working directory. The example file is in the source code.
🖥️ Usage
CLI Usage
buildroid build https://github.com/user/project # Run on a single repository
buildroid build repos.txt # Run on a list of repositories from a file
buildroid build local_path --local # Run with a local repository
buildroid clean # Clean test results
Advanced Options for Builds
-n,--num: Specify cycle limit (max. number of commands to execute)-c,--conv: Enable conversation mode (API works with conversation models)-k,--keep-container: Keep container after build (builDroid removes container by default)-l,--local: Build from a local repository (Provide local path instead of Github link)
Python Usage
import builDroid
# You must load environment variables separately for Python usage
source = "https://github.com/user/project"
builDroid.process_repository(repo_source=source)
# args:
# repo_source: str, num: int=40, conversation: bool=False, extract_project: bool=True, keep_container:bool=False, user_retry:bool=False, local_path:bool=False
🛠️ Troubleshooting
If the build fails, builDroid will attempt to:
- Analyze the error output.
- Query the LLM for common solutions.
- Retry the build with suggested fixes.
❗ Note: Some complex/outdated builds may still require manual intervention.
🏗️ Roadmap
- Integration with emulator for automated APK testing
🤝 Contributing
Pull requests are welcome! For major changes, please open an issue first to discuss.
📜 License
MIT License. See LICENSE for details.
🙏 Acknowledgments
- OpenAI for LLM API
- ExecutionAgent
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file buildroid-1.1.0.tar.gz.
File metadata
- Download URL: buildroid-1.1.0.tar.gz
- Upload date:
- Size: 106.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
985302c6f9f761f0216e8a3d7db11118929f72a088a2bdb3500fbdf3aeddfb76
|
|
| MD5 |
a2aa91a7e216c8ef958f228756b1ae68
|
|
| BLAKE2b-256 |
ddbd2a0e17a0d79b1e903f9d1b28310fc33f3301c5dd697ff26a786041a790a8
|
File details
Details for the file buildroid-1.1.0-py3-none-any.whl.
File metadata
- Download URL: buildroid-1.1.0-py3-none-any.whl
- Upload date:
- Size: 115.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a7f6ce8864304cca144f8c7bd0cc8b2c5cb6f5dcce526afe5502cbb23f5e26ca
|
|
| MD5 |
3adf8f3d3778a502a7a71192b2c33410
|
|
| BLAKE2b-256 |
b1fd796d4bae971fd86f82e682c6e9653cd07ec370569162caa1e2334ab00683
|