LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

adb-shell

Run a remote shell on an Android device

TLDR

Open an interactive shell on the device
$ adb shell
copy
Run a single command
$ adb shell [ls /sdcard]
copy
Run command as root (if available)
$ adb shell su -c "[command]"
copy
List files with details
$ adb shell ls -la [/system/]
copy

SYNOPSIS

adb shell [-e escape] [-n] [-T|-t] [-x] [command]

DESCRIPTION

adb shell provides shell access to a connected Android device. Without arguments, it opens an interactive shell session. With arguments, it executes the specified command and returns the output.The shell is a limited Unix environment with access to Android-specific commands like am (activity manager), pm (package manager), dumpsys, and content. Available commands depend on the device and whether root access is available.

PARAMETERS

-e char

Set escape character (default: ~)
-n
Don't read from stdin
-T
Disable PTY allocation
-t
Force PTY allocation
-x
Disable remote exit codes

INSTALL

sudo apt install adb
copy
sudo dnf install android-tools
copy
sudo pacman -S android-tools
copy
sudo apk add android-tools-adb
copy
sudo zypper install android-tools
copy
nix profile install nixpkgs#android-tools
copy

CAVEATS

Shell commands run as the "shell" user with limited permissions. Root access requires an unlocked bootloader or rooted device. Not all standard Unix commands are available. The shell environment may vary between Android versions and manufacturers.

HISTORY

adb shell has been part of the Android SDK since its initial release in 2008. The shell has evolved from a basic Toolbox implementation to the more capable Toybox on modern Android versions.

SEE ALSO

RESOURCES

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid