• Stars
    star
    1,215
  • Rank 38,569 (Top 0.8 %)
  • Language
    Python
  • License
    Apache License 2.0
  • Created almost 8 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🔪Swiss-army knife for Android testing and development 🔪 ⛺

ADB Enhanced Downloads PyPI version

Lint Python Lint Markdown Lint YAML

InstallAdbeTest

AdbeInstallTests AdbeUnitTests

AdbeUnitTests-Api16 AdbeUnitTests-Api21 AdbeUnitTests-Api22 AdbeUnitTests-Api23 AdbeUnitTests-Api24 AdbeUnitTests-Api25 AdbeUnitTests-Api26 AdbeUnitTests-Api27 AdbeUnitTests-Api28 AdbeUnitTests-Api29 AdbeUnitTests-Api31 AdbeUnitTests-Api30 AdbeUnitTests-Api31 AdbeUnitTests-Api32 AdbeUnitTests-Api33

Packaging status

Logo

ADB-Enhanced is a Swiss-army knife for Android testing and development. A command-line interface to trigger various scenarios like screen rotation, battery saver mode, data saver mode, doze mode, permission grant/revocation. Its a wrapper around adb and not a replacement.

asciicast

Release announcement

See Release announcement

Installation

sudo pip3 install adb-enhanced

Note

  1. sudo pip install adb-enhanced for python2 based install works as well but, I would recommend moving to python3 since I will deprecate python2 support anytime after Dec 31, 2018.
  2. If you don't have sudo access or you are installing without sudo then adbe might not be configured correctly in the path.
  3. To setup bash/z-sh auto-completion, execute sudo pip3 install infi.docopt-completion && docopt-completion $(which adbe) after installing adb-enhanced.

Examples

Device configuration

  • Turn doze mode on

    adbe doze on

  • Turn mobile-data off

    adbe mobile-data off

  • Turn on battery saver

    adbe battery saver on

  • Don't keep activities in the background

    adbe dont-keep-activities on

  • Take a screenshot adbe screenshot ~/Downloads/screenshot1.png

  • Take a video adbe screenrecord video.mp4 # Press ^C when finished

  • Turn Wireless Debug mode on adbe enable wireless debugging

Permissions

  • Grant storage-related runtime permissions

    adbe permissions grant com.example storage

  • Revoke storage-related runtime permissions

    adbe permissions revoke com.example storage

Interacting with app

  • Start an app

    adbe start com.example

  • Kill an app

    adbe force-stop com.example

  • Clear app data - equivalent of uninstall and reinstall

    adbe clear-data com.example

  • ls/cat/rm any file without worrying about adding "run-as" or "su root"

    adbe ls /data/data/com.example/databases # Works as long as com.example is a debuggable package or shell has the root permission or directory has been made publicly accessible

Device info

  • Detailed device info including model name, Android API version etc, device serial

    $ adbe devices
    Unlock Device "dcc54112" and give USB debugging access to this PC/Laptop by unlocking and reconnecting the device. More info about this device: "unauthorized usb:339869696X transport_id:17"
    
    Serial ID: dcc54111
    Manufacturer: OnePlus
    Model: ONEPLUS A5000 (OnePlus 5T)
    Release: 8.1.0
    SDK version: 27
    CPU: arm64-v8a
    
    Serial ID: emulator-5554
    Manufacturer: unknown
    Model: Android SDK built for x86
    Release: 4.4.2
    SDK version: 19
    CPU: x86

App info

  • Detailed information about app version, target SDK version, permissions (requested, granted, denied), installer package name, etc.

    $ adbe app info com.google.android.youtube
    App name: com.google.android.youtube
    Version: 12.17.41
    Version Code: 121741370
    Is debuggable: False
    Min SDK version: 21
    Target SDK version: 26
    
    Permissions:
    
    Install time granted permissions:
    com.google.android.c2dm.permission.RECEIVE
    android.permission.USE_CREDENTIALS
    com.google.android.providers.gsf.permission.READ_GSERVICES
    com.google.android.youtube.permission.C2D_MESSAGE
    android.permission.MANAGE_ACCOUNTS
    android.permission.SYSTEM_ALERT_WINDOW
    android.permission.NFC
    android.permission.CHANGE_NETWORK_STATE
    android.permission.RECEIVE_BOOT_COMPLETED
    com.google.android.gms.permission.AD_ID_NOTIFICATION
    android.permission.INTERNET
    android.permission.GET_PACKAGE_SIZE
    android.permission.ACCESS_NETWORK_STATE
    android.permission.VIBRATE
    android.permission.ACCESS_WIFI_STATE
    android.permission.WAKE_LOCK
    
    Runtime Permissions not granted and not yet requested:
    android.permission.WRITE_EXTERNAL_STORAGE
    android.permission.MANAGE_DOCUMENTS
    android.permission.GET_ACCOUNTS
    android.permission.CAMERA
    android.permission.RECORD_AUDIO
    android.permission.READ_CONTACTS
    android.permission.ACCESS_FINE_LOCATION
    android.permission.ACCESS_COARSE_LOCATION
    android.permission.READ_PHONE_STATE
    android.permission.SEND_SMS
    android.permission.RECEIVE_SMS
    com.sec.android.provider.badge.permission.READ
    com.sec.android.provider.badge.permission.WRITE
    com.htc.launcher.permission.READ_SETTINGS
    com.htc.launcher.permission.UPDATE_SHORTCUT
    com.sonyericsson.home.permission.BROADCAST_BADGE
    com.sonymobile.home.permission.PROVIDER_INSERT_BADGE
    android.permission.READ_EXTERNAL_STORAGE
    
    Installer package name: None
  • App backup to a tar file unlike the Android-specific .ab format

    $ adbe app backup com.google.android.youtube backup.tar
    you might have to confirm the backup manually on your device's screen, enter "00" as password...
    Successfully backed up data of app com.google.android.youtube to backup.tar

Usage

adbe [options] (enable | disable) wireless debugging
adbe [options] airplane (on | off)
adbe [options] alarm (all | top | pending | history)
adbe [options] animations (on | off)
adbe [options] app backup <app_name> [<backup_tar_file_path>]
adbe [options] app info <app_name>
adbe [options] app path <app_name>
adbe [options] app signature <app_name>
adbe [options] apps list (all | system | third-party | debug | backup-enabled)
adbe [options] battery level <percentage>
adbe [options] battery reset
adbe [options] battery saver (on | off)
adbe [options] cat <file_path>
adbe [options] clear-data <app_name>
adbe [options] dark mode (on | off)
adbe [options] devices
adbe [options] dont-keep-activities (on | off)
adbe [options] doze (on | off)
adbe [options] dump-ui <xml_file>
adbe [options] force-stop <app_name>
adbe [options] gfx (on | off | lines)
adbe [options] input-text <text>
adbe [options] install <file_path>
adbe [options] jank <app_name>
adbe [options] layout (on | off)
adbe [options] location (on | off)
adbe [options] ls [-a] [-l] [-R|-r] <file_path>
adbe [options] mobile-data (on | off)
adbe [options] mobile-data saver (on | off)
adbe [options] mv [-f] <src_path> <dest_path>
adbe [options] notifications list
adbe [options] open-url <url>
adbe [options] overdraw (on | off | deut)
adbe [options] permission-groups list all
adbe [options] permissions (grant | revoke) <app_name> (calendar | camera | contacts | location | microphone | phone | sensors | sms | storage)
adbe [options] permissions list (all | dangerous)
adbe [options] press back
adbe [options] pull [-a] <file_path_on_android>
adbe [options] pull [-a] <file_path_on_android> <file_path_on_machine>
adbe [options] push <file_path_on_machine> <file_path_on_android>
adbe [options] restart <app_name>
adbe [options] restrict-background (true | false) <app_name>
adbe [options] rm [-f] [-R|-r] <file_path>
adbe [options] rotate (landscape | portrait | left | right)
adbe [options] rtl (on | off)
adbe [options] screen (on | off | toggle)
adbe [options] screenrecord <filename.mp4>
adbe [options] screenshot <filename.png>
adbe [options] show-taps (on | off)
adbe [options] standby-bucket get <app_name>
adbe [options] standby-bucket set <app_name> (active | working_set | frequent | rare)
adbe [options] start <app_name>
adbe [options] stay-awake-while-charging (on | off)
adbe [options] stop <app_name>
adbe [options] top-activity
adbe [options] uninstall [--first-user] <app_name>
adbe [options] wifi (on | off)

Options

-e, --emulator          directs the command to the only running emulator
-d, --device            directs the command to the only connected "USB" device
-s, --serial SERIAL     directs the command to the device or emulator with the given serial number or qualifier.
                        Overrides ANDROID_SERIAL environment variable.
-l                      For long list format, only valid for "ls" command
-R                      For recursive directory listing, only valid for "ls" and "rm" command
-r                      For delete file, only valid for "ls" and "rm" command
-f                      For forced deletion of a file, only valid for "rm" command
-v, --verbose           Verbose mode

Python3 migration timeline

  • Nov 27, 2017 - Code is Python3 compatible
  • Jan 18, 2018 - pip (python package manager) has the updated version which is Python3 compatible
  • Nov 15, 2018 - Python2 based installation discouraged. Python3 is recommended.
  • Dec 31, 2018 - Python2 will not be officially supported after Dec 31, 2018.
  • May 7, 2020 - Python2 no longer works with the current master branch

Testing

make lint
make test

Release a new build

A new build can be released using release/release.py script. Build a test release via make release_debug. Build a production release via make release_production

Updating docs for ReadTheDocs

make documentation

Note that this happens automatically during make release_production.

You will have to do brew install pandoc if you are missing pandoc.

Note: The inspiration of this project came from android-scripts.

More Repositories

1

android-security-awesome

A collection of android security related resources
Shell
8,115
star
2

osx-and-ios-security-awesome

OSX and iOS related security tools
Shell
1,306
star
3

android-malware

Collection of android malware samples
Shell
1,049
star
4

wp2hugo

The best WordPress to static site migrator
Go
209
star
5

gabo

GitHub Actions Boilerplate Generator
Go
98
star
6

dotfiles

Dotfiles for developers (with CI testing)
Shell
85
star
7

personal-finance-awesome

List of personal finance related websites
Shell
40
star
8

outbound-link-checker

A useful tool for checking and listing outbound links of a website
Go
39
star
9

ios-malware

iOS malware samples
34
star
10

androidtool

A better version of the command-line android tool with a more intuitive command-line interface.
Python
31
star
11

golang-template-repo

Template repository for starting a project on Go + Docker + Google cloud stack
Makefile
31
star
12

python_dep_generator

Genrates python dependency graph
Python
21
star
13

android-auto-translate

Auto translate strings.xml on Android
Python
15
star
14

cryptocurrency-security-awesome

Cryptocurrencies related Security resources
14
star
15

ReverseShell

AndroidReverseShell
10
star
16

android_emulator

A customized version of Android Emulator
C
9
star
17

python_test_skeleton

Python unittest skeleton generator.
Python
8
star
18

Netcat-for-Android

TCP/IP swiss army knife for Android
Java
7
star
19

CheckDeviceCredentials

Force device credential check before decrypting data
Kotlin
5
star
20

samsung_hackathon

Samsung HAckathon
5
star
21

citool

Circle CI analysis tool
Go
4
star
22

Similar-Ethereum-Address-Finder

Find an Ethereum address matching a particular (prefix, suffix) pair(s)
Go
4
star
23

startup_school_2014

Startup School 2014 (half baked notes)
4
star
24

BloatwareMonitor

Bloatware Monitor for Android
Java
3
star
25

chainshot-solutions

Solutions to Chainshot.com exercises
JavaScript
2
star
26

benchmarking

Benchmarking of random libraries
Python
2
star
27

android_time_tracker

Android Time Tracker app
Java
2
star
28

AppInfo

An app which shows info about apps installed on the device
Java
2
star
29

python_based_web_frontend_test

A testing framework for testing (and ensuring) that all web based end points are tested.
Python
2
star
30

BhaskarScraper

Dainik Bhaskar Scraper
Python
2
star
31

JavascriptToJavaAndroidBridgeCallDemo

A small Android app demonstrating how Exceptions in Java code invoked from Javascript are swallowed
Kotlin
2
star
32

ByThePeople

By The People
Java
2
star
33

Farsight

C++
2
star
34

android_gradle_demo

A small app used for demonstrating gradle basics.
Java
2
star
35

bulldozer-testing

Bulldozer (Palantir) testing
2
star
36

cookbook

A cookbook of random pieces of code.
1
star
37

sdlx

Automatically exported from code.google.com/p/sdlx
1
star
38

device_properties

Android Device Properties app
Java
1
star
39

monitoring

Monitoring a list of variables whose variables are returned by a REST api call and plots them on a chart
CSS
1
star
40

vjde

VJDE - vundle plugin for Java IDE for Vim
1
star
41

dateparse

A robust date parser library for GoLang based on the actual date patterns I have seen in the wild
Go
1
star
42

android-linter

1
star
43

prework-repo

Codepath prework repo
Java
1
star
44

dca_analysis

Dollar-cost Analysis
Python
1
star
45

amazon_hero_widget_demo

Amazon Fire Hero Widget Demo
Java
1
star