Python wrapper for AOSP tasks
Project description
aosp
Python wrapper around an AOSP (Android Open Source Project) source tree. Sources build/envsetup.sh, runs lunch, exposes the resulting build environment as a Python object, and provides convenience accessors for the product-out tree.
Requires sh and yautil (uses docker_sh for sandboxed builds).
Install
pip install -e .
Python ≥ 3.9.
API
from aosp import Aosp, load_aosp, get_env
Aosp
Main object representing one AOSP checkout + build target.
aosp = Aosp(path="/path/to/aosp", build_target="aosp_arm64-eng")
# or
aosp = Aosp.from_path("/path/to/aosp", build_target="aosp_arm64-eng")
Notable properties:
| Member | Description |
|---|---|
path |
Absolute path to the AOSP root. |
build_target |
The lunch target. |
env |
dict of env vars exported by envsetup.sh + lunch. |
build_var |
dict of build variables from get_build_var. |
out |
AospProductOut — wrapper around $ANDROID_PRODUCT_OUT. |
external_paths |
Extra PATH entries injected when running commands inside the tree. |
AospProductOut
Returned by Aosp.out. Helpers for locating files under $ANDROID_PRODUCT_OUT:
| Member | Returns |
|---|---|
dir |
Absolute path of the product-out directory. |
system_dir |
system/ partition root. |
system_lib_dirs |
All directories on the target's LD_LIBRARY_PATH. |
system_bin_dirs |
All directories on the target's PATH. |
rc_path |
Path to the target's init *.rc. |
find_system_lib(basename) |
List of matching library files across system_lib_dirs. |
find_system_bin(basename) |
List of matching binaries across system_bin_dirs. |
load_aosp(...)
Module-level factory (see aosp.aosp.load_aosp) that constructs an Aosp from a config profile.
get_env(path, target=None) -> dict
Lower-level helper: sources build/envsetup.sh in path (and optionally runs lunch <target>), then returns the resulting environment as a dict.
env = get_env("/path/to/aosp", "aosp_arm64-eng")
print(env["ANDROID_PRODUCT_OUT"])
Project details
Release history Release notifications | RSS feed
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 aosp-0.1.1.tar.gz.
File metadata
- Download URL: aosp-0.1.1.tar.gz
- Upload date:
- Size: 7.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7beb4660ab84a830a44d3fbdcc038cb79ea39dac00e5f21e9036b8ac0db60d1f
|
|
| MD5 |
ca57fc702123448a09d0b419f10aa937
|
|
| BLAKE2b-256 |
11cc9304b47573402835d1ffa8f616878f5b33bb7008d05517486b4bc0b2b319
|
File details
Details for the file aosp-0.1.1-py3-none-any.whl.
File metadata
- Download URL: aosp-0.1.1-py3-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4d7d3427fa1e7b43c23cda972db7157fe737cb6151baa0ae233b71ec171a2f79
|
|
| MD5 |
e7e174346d92b106bd8e4781e2c4c7a0
|
|
| BLAKE2b-256 |
3acad3c6eb898f62a7f8599068b9172dfc8d637b58ea3a476f0d7f3f5a9ba19f
|