LinuxCommandLibrary

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

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

adb(1), adb-shell-pm(1), toybox(1)

> TERMINAL_GEAR

Curated for the Linux community

GMKtec Gaming PC, K11 AMD Ryzen 9 8945HS, 32GB DDR5 RAM 1TB Mini PC Desktop Computer, Oculink, Dual NIC 2.5GbE LAN, HDMI/DisplayPort/USB4*2

GMKtec Gaming PC, K11 AMD Ryzen 9 8945HS, 32GB DDR5 RAM 1TB Mini PC Desktop Computer, Oculink, Dual NIC 2.5GbE LAN, HDMI/DisplayPort/USB4*2

$739.99
BOSGAME Mini PC N95, Intel 12th Mini Computers| 16GB DDR4 RAM| 512GB M.2 2280 SSD| 4K 60HZ Triple Displays by Dual HDMI+Type-C, 6W TDP Quiet Mini PC, WIFI5, BT 5.0 Office

BOSGAME Mini PC N95, Intel 12th Mini Computers| 16GB DDR4 RAM| 512GB M.2 2280 SSD| 4K 60HZ Triple Displays by Dual HDMI+Type-C, 6W TDP Quiet Mini PC, WIFI5, BT 5.0 Office

$239.99
KIWITATA 2X Classic SNES USB Controller for PC Gamings, Retro SNES Wired USB Game Emulator Controller for Windows XP 7 8 11 Mac Raspberry Pi

KIWITATA 2X Classic SNES USB Controller for PC Gamings, Retro SNES Wired USB Game Emulator Controller for Windows XP 7 8 11 Mac Raspberry Pi

$16.99
Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community

KIWITATA 2X Classic SNES USB Controller for PC Gamings, Retro SNES Wired USB Game Emulator Controller for Windows XP 7 8 11 Mac Raspberry Pi

KIWITATA 2X Classic SNES USB Controller for PC Gamings, Retro SNES Wired USB Game Emulator Controller for Windows XP 7 8 11 Mac Raspberry Pi

$16.99
Bmax Mini PC B2 Power Intel 5205U 8GB DDR4 256GB M.2 NVMe SSD ,HDMI 1.4&DP 1.2, USB3.2,4K Dual Display 2.4G/5G WiFi & BT5.0 Mini Desktop Computers /Office/Design

Bmax Mini PC B2 Power Intel 5205U 8GB DDR4 256GB M.2 NVMe SSD ,HDMI 1.4&DP 1.2, USB3.2,4K Dual Display 2.4G/5G WiFi & BT5.0 Mini Desktop Computers /Office/Design

$169.99
GMKtec Gaming PC, K11 AMD Ryzen 9 8945HS, 32GB DDR5 RAM 1TB Mini PC Desktop Computer, Oculink, Dual NIC 2.5GbE LAN, HDMI/DisplayPort/USB4*2

GMKtec Gaming PC, K11 AMD Ryzen 9 8945HS, 32GB DDR5 RAM 1TB Mini PC Desktop Computer, Oculink, Dual NIC 2.5GbE LAN, HDMI/DisplayPort/USB4*2

$739.99