ADB commands are not always intuitive. They are also not easy to remember. There is also a lot of bad advice out there. ADBX hopes to solve that.
-
Tab completion
-
Command discovery:
-
Package validation
-
Combine common operations into single commands
-
Detecting rooted device. Some operations can't be performed on non-rooted devices. We'll detect that before running commands
-
Encapsulating best practices. There are lots of hacky, half-correct suggestions floating around the internet.
| feature | complete |
|---|---|
| tab completion | X |
| command discovery | X |
| package validation | X |
| detect rooted devices |
Setup wifi connection. This downloads, installs, and runs adb-join-wifi
Sets airplane mode to on or off. Non-rooted devices will require a reboot.
Sets window animation scale, transition animation scale, and animator duration scale.
Clear all app data, including cache and accepted permissions
Toggles on or off System UI Demo Mode
Disable device's audio, per stream. Supports all AudioManager.STREAM_*:
- accessibility
- alarm
- dtmf
- music
- notification
- ring
- system
- voice_call
Print device's display size and density
Set display scale. Mimics small, default, large, larger, largest options as if set from system Settings app.
Set accessibility font scale. Mimics small, default, large, largest options as if set from system Settings app.
Launch an app by package name
Show or hide layout bounds
List all installed packages (system and non-system)
Set screen to maximum brightness
Set device night mode (aka dark mode) on, off, or auto. auto will "automatically switches [night mode] based on the device current location and certain other sensors"
List entire dumpsys for a package, with highlighting for granted and not granted permissions:
Print information on device's processor(s)
Pull all apks from device to local machine, for a given package. Optionally set location on local machine
Reboot device
Capture a device screenshot, saving to optional destination, or current directory with timestamp filename.
Launch system Settings app
List all shared preferences files within a package
Print the content of a single shared preferences file within a package
Remove a single value from a shared preferences file within a package
Set Talkback on or off
Uninstalls package by name
Print package's version name
ADBX supports a standard adbx.config file. ADBX will search up the directory tree from the call point and apply configs as found. See adbx.config.example
package- For all commands that require a--packageagumenet, it can be ommited if a package is defined in the config
These scripts run as ruby commands. Install latest ruby 3.x. Known working versions:
- Ruby 3.4.1
ADBX relies on Bash Completion 2. Read more about why here
- update to latest Bash (4+): directions here
- install
bash-complete@2read more
$ brew install bash-completion@2
- update
~/.bashrcby adding
export BASH_COMPLETION_COMPAT_DIR="/usr/local/etc/bash_completion.d"
[[ -r "/usr/local/etc/profile.d/bash_completion.sh" ]] && . "/usr/local/etc/profile.d/bash_completion.sh"
- source both
axcommand and completion script. Add to~/.bashrc:
export PATH=$PATH:path/to/ADBX
source path/to/ADBX/ax_completion.bash
- open new terminal window
$ ax [TAB]- see list of completable actions
To ensure code quality, a pre-push hook should be added:
#!/bin/bash
# Run rubocop before pushing
echo "Running rubocop..."
rubocop
# Check if rubocop passed
if [ $? -ne 0 ]; then
echo "Rubocop checks failed. Aborting push."
exit 1
fi
echo "Rubocop checks passed."
# Run tests before pushing
echo "Running tests..."
ruby tests/find_configs_test.rb
# Check if tests passed
if [ $? -ne 0 ]; then
echo "Tests failed. Aborting push."
exit 1
fi
echo "All tests passed. Proceeding with push."


