Adds new functionality to Android Debug Bridge and extend its usability to work with multiple devices or emulators at a time.
Requires Android Debug Bridge
Requires aapt (only for uninstall)
Selection Filters
-d - physical devices
-e - emulators
-a - selects all
-ad - automatically selects all physical devices
-ae - automatically selects all emulators
Commands Available
adb help - shows usage of the script
adb l - lists connected devices
adb s - takes a screenshot on selected devices
adb t "text input" - types on selected devices
adb i <file> - pushes this package file to selected devices and installs it (overinstall)
adb u <file> - removes this app package from selected devices
adb c <file> - force closes app and clears data
adb <adb command> - executes command using original adb
Install
-
Ensure that you have adb installed (and aapt if you want uninstall)
-
Set ANDROID_HOME correctly in the PATH
-
Download crab.sh
-
cd into the folder with crab.sh
-
Set up an alias for the script to redirect adb by typing the following:
alias adb=./crab.sh
Note: The alias can be removed anytime by typing the following:
unalias adb
Usage
Type commands like this:
crab <selection filter> <command>
Bugs/Future Enhancements
- commands with | (pipes) do not work with selection filters
- "Number of devices found: X" is outputted when running help command with a filter
- Install/uninstall does not work if apk name has a space?
- batch installation
- clear data
- screen recording