ADB Shell Commands

The Android Debug Bridge (adb) provides a Unix shell that you can use to run a variety of commands on an emulator or connected device.

 

ADB Shell Commands

https://developer.android.com/intl/es/tools/help/shell.html


 

Issuing Shell Commands

You can use the shell command to issue commands, with or without entering the adb remote shell on the emulator/device. To issue a single command without entering a remote shell, use the shell command like this:
[crayon-6a85f29f6bb9a275981096/]
 

List of all attached device
[crayon-6a85f29f6bba3261176878/]
 

Download a specified file from an device to your computer
[crayon-6a85f29f6bba5607166644/]
 

Upload a specified file from your computer to an device
[crayon-6a85f29f6bba8701503908/]
 

List directory contents
[crayon-6a85f29f6bbaa246285180/]
 

Change directory
[crayon-6a85f29f6bbac543906016/]
 

Remove files or directories
[crayon-6a85f29f6bbae739859051/]
 

Make directories
[crayon-6a85f29f6bbb0867321587/]
 

Create empty file
[crayon-6a85f29f6bbb2972862007/]
 

Current working directory location
[crayon-6a85f29f6bbb4457766169/]
 

Copy files and directories
[crayon-6a85f29f6bbb6144420236/]
 

Move or rename files
[crayon-6a85f29f6bbb8289396433/]
 

Starts (restarts) an emulator/device instance
[crayon-6a85f29f6bbba246129897/]
 

Stops execution of an emulator/device instance
[crayon-6a85f29f6bbbc463704884/]
 

Prints kernel debugging messages to the screen
[crayon-6a85f29f6bbbe535830242/]
 

Show/manipulate routing, devices, policy routing and tunnels
[crayon-6a85f29f6bbbf624121954/]
 

Network statistics
[crayon-6a85f29f6bbc1294065099/]
 

Network connection tool
[crayon-6a85f29f6bbc2040156372/]
 

Test the connection and latency between two network connection
[crayon-6a85f29f6bbc4882318677/]
 

Using activity manager (am)

Activity manager (am) tool to perform various system actions, such as start an activity, force-stop a process, broadcast an intent, modify the device screen properties, and more. While in a shell, the syntax is:
[crayon-6a85f29f6bbc5256386482/]
Available activity manager commands:

Start an Activity specified by .
[crayon-6a85f29f6bbc7597912994/]
Start the Service specified by .
[crayon-6a85f29f6bbc8526507022/]
Kill all processes associated with [crayon-6a85f29f6bbca979791867/]
 

Using package manager (pm)

Within an adb shell, you can issue commands with the package manager (pm) tool to perform actions and queries on application packages installed on the device. While in a shell, the syntax is:
[crayon-6a85f29f6bbcb884920224/]
Available activity manager commands:

Prints all packages, optionally only those whose package name contains the text in .
[crayon-6a85f29f6bbcd077789578/]
Prints all known permission groups
[crayon-6a85f29f6bbce425803338/]
Prints all known permissions, optionally only those in
[crayon-6a85f29f6bbd0406178367/]
Prints all features of the system
[crayon-6a85f29f6bbd1152770070/]
Prints all users on the system
[crayon-6a85f29f6bbd3481373189/]
Installs a package (specified by ) to the system [crayon-6a85f29f6bbd4373624017/]
 

Taking a device screenshot

The screencap command is a shell utility for taking a screenshot of a device display. While in a shell, the syntax is:
[crayon-6a85f29f6bbd7551285761/]
 

Recording a device screen

The screenrecord command is a shell utility for recording the display of devices running Android 4.4 (API level 19) and higher. The utility records screen activity to an MPEG-4 file.
[crayon-6a85f29f6bbd9375097214/]
 

List of all the available shell programs
[crayon-6a85f29f6bbdb345325766/]
 

More commands
[crayon-6a85f29f6bbdd778997110/]