Skip to main content

Adbtool

A friendly android adb command-line tool

Test 😎 PyPI PyPI

Python Requirements

  • python 3.13+
  • uv
  • Android SDK (for APK/XAPK commands)
  • HarmonyOS/OpenHarmony SDK (for HDC commands and 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,hdc,devices,push,install,uninstall,apk,sign,ab,il2cpp}
    adb                 forward adb arguments to selected devices
    hdc                 forward hdc 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/--devices before -- belongs to adbt adb
  • repeat -d/--devices or separate selectors with commas to select multiple devices
  • everything after -- is passed to the real adb binary without extra parsing
  • adbt adb -h shows the adbt subcommand help
  • adbt adb -- -h shows the real adb help
adbt adb -h
usage: adbt adb [-h] [-d [DEVICE]] -- [adb_args ...]

adbt hdc -- shell
adbt hdc -d 1 -- shell
adbt hdc -d a -- shell pwd
adbt hdc -d 1 -d serial-prefix -- shell
adbt hdc -d 1,serial-prefix -- shell
adbt hdc -- -h

adbt hdc uses the HDC target list and follows the same selection and argument forwarding rules as adbt adb.

  • -d/--devices before -- selects HDC targets by index, serial prefix, or a
  • repeat -d/--devices or separate selectors with commas to select multiple targets
  • everything after -- is passed to the real hdc binary without extra parsing
  • each selected target is invoked as hdc -t <serial> ...
  • adbt hdc -h shows the adbt subcommand help
  • adbt hdc -- -h shows the real hdc help
  • the HDC tool directory uses the top-level hdc setting in adbtool.yml
adbt hdc -h
usage: adbt hdc [-h] [-d [DEVICE]] -- [hdc_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
  • install accepts 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/--force upgrades it to adb -d -r.
  • HAP files use hdc -t <device> install -r; -f/--force upgrades it to -d -r.
  • multiple HAP paths are installed together; HAP cannot be mixed with APK/XAPK, and --run is not supported for HAP.
  • configure the HDC tool directory with the top-level hdc key in adbtool.yml. On Windows, the DevEco Studio default is checked before PATH:
hdc: C:\Program Files\Huawei\DevEco Studio\sdk\default\openharmony\toolchains
  • repeat --filter or 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

adbtool-0.0.43.tar.gz (1.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

adbtool-0.0.43-py3-none-any.whl (32.2 kB view details)

Uploaded Python 3

File details

Details for the file adbtool-0.0.43.tar.gz.

File metadata

  • Download URL: adbtool-0.0.43.tar.gz
  • Upload date:
  • Size: 1.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for adbtool-0.0.43.tar.gz
Algorithm Hash digest
SHA256 65a48fbfd64ad42fa3cc08f32a3976efe084bd42fc9aa14ed1986be3d8376504
MD5 5053d718253233b4de26a9133cf4408f
BLAKE2b-256 58ceaf675c422125953e7999e321348022c64bfbeb29c9e51b1e1b1aa2406037

See more details on using hashes here.

Provenance

The following attestation bundles were made for adbtool-0.0.43.tar.gz:

Publisher: pythonpublish.yml on litefeel/adbtool

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file adbtool-0.0.43-py3-none-any.whl.

File metadata

  • Download URL: adbtool-0.0.43-py3-none-any.whl
  • Upload date:
  • Size: 32.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for adbtool-0.0.43-py3-none-any.whl
Algorithm Hash digest
SHA256 1d97de39598a5dfee9ddd4d054f3de2d876755cf3065b44cdece48ffc381addd
MD5 781150be3f95cdb354147dc6a8b2e741
BLAKE2b-256 f68b4ad9518252fea03fb1deac546ad06d1e63396729b6a407d0f472faf9d463

See more details on using hashes here.

Provenance

The following attestation bundles were made for adbtool-0.0.43-py3-none-any.whl:

Publisher: pythonpublish.yml on litefeel/adbtool

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.0.44

2 files

This release

0.0.43 This release

2 files

0.0.42

2 files

0.0.41

2 files

0.0.39

2 files

0.0.38

2 files

0.0.37

2 files

0.0.36

2 files

0.0.35

2 files

0.0.34

2 files

0.0.33

2 files

0.0.32

2 files

0.0.31

2 files

0.0.30

2 files

0.0.29

2 files

0.0.27

2 files

0.0.26

2 files

0.0.25

2 files

0.0.24

2 files

0.0.23

2 files

0.0.22

2 files

0.0.21

2 files

0.0.20

2 files

0.0.19

2 files

0.0.18

2 files

0.0.17

2 files

0.0.16

2 files

0.0.15

2 files

0.0.14

2 files

0.0.13

2 files

0.0.12

2 files

0.0.11

2 files

0.0.10

2 files

0.0.9

2 files

0.0.8

2 files

0.0.7

2 files

0.0.6

2 files

0.0.5

2 files

0.0.4

2 files

0.0.3

2 files

0.0.2

2 files

0.0.1

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page