Linux command
adb-shell 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Open
adb shell
Run
adb shell [ls /sdcard]
Example
adb shell su -c "[command]"
List
adb shell ls -la [/system/]
说明
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.
参数
- -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
FAQ
What is the adb-shell command used for?
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.
How do I run a basic adb-shell example?
Run `adb shell` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -e _char_ do in adb-shell?
Set escape character (default: ~)