Adbtool
A friendly android adb command-line tool
Python Requirements
- python 3.13+
- uv
- Android SDK (for APK/XAPK commands)
- HarmonyOS/OpenHarmony SDK (for HAP installs)
Development
uv sync
uv run pytest
uv run pytest tests/test_cmd.py
uv run ruff format adbtool tests
uv build
Commands
adbt -h
usage: adbt [options]
show android device list
options:
-h, --help show this help message and exit
-c CONFIG, --config CONFIG
global config
--version show program's version number and exit
sub commands:
{adb,devices,push,install,uninstall,apk,sign,ab,il2cpp}
adb forward adb arguments to selected devices
devices show android device list
push push files to android device
install install apk, xapk, or hap file
uninstall uninstall apk file
apk show apk packageName/activityName
sign sign apk with android debug(only windows)
ab extract unity asset bundle information
il2cpp extract unity il2cpp information
adbt adb -- devices
adbt adb -d 1 -- shell
adbt adb -d a -- shell pwd
adbt adb -d 1 -d emulator-5554 -- shell
adbt adb -d 1,emulator-5554 -- shell
adbt adb -- -H localhost devices
adbt adb -d 1 -- -d shell
adbt adb supports the same device selection flow as install, and adb arguments must
be placed after --.
-d/--devicesbefore--belongs toadbt adb- repeat
-d/--devicesor separate selectors with commas to select multiple devices - everything after
--is passed to the realadbbinary without extra parsing adbt adb -hshows theadbtsubcommand helpadbt adb -- -hshows the realadbhelp
adbt adb -h
usage: adbt adb [-h] [-d [DEVICE]] -- [adb_args ...]
adbt devices -h
usage: adbt [options] devices [-h] [-d DEVICE] [-l]
optional arguments:
-h, --help show this help message and exit
-d DEVICE, --devices DEVICE
filter of devices, [n | serial | a]; repeat the option or separate values with commas
-l, --list show devices list
adbt push -h
usage: adbt [options] push [-h] [-r] [-n] [-j [HASHJSON]] [--hash [{sha1,mtime}]] [--localdir LOCALDIR]
[--remotedir REMOTEDIR] [--dontpush] [-d [DEVICE]]
[path [path ...]]
positional arguments:
path file or directory
optional arguments:
-h, --help show this help message and exit
-r recursion all file
-n only push new file by last modify files, see -j
-j [HASHJSON] hash json file, default: ./$deviceMode_$deviceSerial.json
--hash [{sha1,mtime}]
hash function: mtime or sha1, default:mtime
--localdir LOCALDIR local prefix and remote prefix, will replace local prefix to remote prefix
--remotedir REMOTEDIR
local prefix and remote prefix, will replace local prefix to remote prefix
--dontpush only outout json file, not really push file to remote
-d, --devices [DEVICE]
filter of devices, [a | n | serial] a: all devices n: index of devices list(start with 1)
serial: devices serial (at least 2 char); repeat the option or separate values with commas;
not argument is show device list
adbt install -h
usage: adbt [options] install [-h] [-f] [--filter FILTER] [-r] [-d [DEVICE]] [apkpath ...]
positional arguments:
apkpath apk/xapk/hap file or directory
optional arguments:
-h, --help show this help message and exit
-f, --force allow downgrade and replace existing app
--filter FILTER filter by file name; repeat the option or separate values with commas
-r, --run run app after install
-d, --devices [DEVICE]
filter of devices, [a | n | serial] a: all devices n: index of devices list(start with 1)
serial: devices serial (at least 2 char); repeat the option or separate values with commas;
not argument is show device list
installaccepts APK, XAPK, and HAP files. A directory selects the newest matching package.- multiple APK paths use
adb install-multi-package; an XAPK must be installed by itself. - XAPK split APKs use
adb install-multiple; declared OBB files are pushed to/sdcard/Android/obb/<package>/after installation. - default install mode uses
adb -r;-f/--forceupgrades it toadb -d -r. - HAP files use
hdc -t <device> install -r;-f/--forceupgrades it to-d -r. - multiple HAP paths are installed together; HAP cannot be mixed with APK/XAPK, and
--runis not supported for HAP. - configure the HDC tool directory with the top-level
hdckey inadbtool.yml. On Windows, the DevEco Studio default is checked before PATH:
hdc: C:\Program Files\Huawei\DevEco Studio\sdk\default\openharmony\toolchains
- repeat
--filteror separate filter values with commas when all terms must match.
adbt install -d a C:\path\app.apk
adbt install -d a C:\path\game.xapk
adbt install -d a C:\path\app.hap
adbt install -d 1 -d emulator-5554 C:\path\app.apk
adbt install --filter ZGame,arm64 --filter gp C:\path\builds
adbt apk -h
usage: adbt [options] apk [-h] [-r] [-d [DEVICE]] [apkpath]
positional arguments:
apkpath
optional arguments:
-h, --help show this help message and exit
-r, --run run app
-d, --devices [DEVICE]
filter of devices, [a | n | serial] a: all devices n: index of devices list(start with 1)
serial: devices serial (at least 2 char); repeat the option or separate values with commas;
not argument is show device list
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 adbtool-0.0.41.tar.gz.
File metadata
- Download URL: adbtool-0.0.41.tar.gz
- Upload date:
- Size: 1.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
285eb54c626aa3a11325e8944227c470ef8c50aa95786234520838f2510f1496
|
|
| MD5 |
0ff4b05b207a3abc8a4f071d9ee36c9c
|
|
| BLAKE2b-256 |
a482bb4c23ee1503db49338df464e1f47f8c386b74a3cfd9c871c477ad632ba0
|
Provenance
The following attestation bundles were made for adbtool-0.0.41.tar.gz:
Publisher:
pythonpublish.yml on litefeel/adbtool
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
adbtool-0.0.41.tar.gz -
Subject digest:
285eb54c626aa3a11325e8944227c470ef8c50aa95786234520838f2510f1496 - Sigstore transparency entry: 2515188299
- Sigstore integration time:
-
Permalink:
litefeel/adbtool@c19708b7bcbc0594a043ac0552f6551805769eac -
Branch / Tag:
refs/tags/0.0.41 - Owner: https://github.com/litefeel
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pythonpublish.yml@c19708b7bcbc0594a043ac0552f6551805769eac -
Trigger Event:
release
-
Statement type:
File details
Details for the file adbtool-0.0.41-py3-none-any.whl.
File metadata
- Download URL: adbtool-0.0.41-py3-none-any.whl
- Upload date:
- Size: 31.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7f886c0b87ba60d34642ee21ac98185895955a7a447f68231c38d0c3bace3d27
|
|
| MD5 |
4850adab9ee5377a4e69366d3256768f
|
|
| BLAKE2b-256 |
fc0b773963dc5d1e3834bd5853762fdfff2613106ca4f6f364242092206b344e
|
Provenance
The following attestation bundles were made for adbtool-0.0.41-py3-none-any.whl:
Publisher:
pythonpublish.yml on litefeel/adbtool
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
adbtool-0.0.41-py3-none-any.whl -
Subject digest:
7f886c0b87ba60d34642ee21ac98185895955a7a447f68231c38d0c3bace3d27 - Sigstore transparency entry: 2515188317
- Sigstore integration time:
-
Permalink:
litefeel/adbtool@c19708b7bcbc0594a043ac0552f6551805769eac -
Branch / Tag:
refs/tags/0.0.41 - Owner: https://github.com/litefeel
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pythonpublish.yml@c19708b7bcbc0594a043ac0552f6551805769eac -
Trigger Event:
release
-
Statement type: