Category filter

How to execute ADB commands on Android devices remotely?

In this doc, you will learn how to execute ADB commands on Android devices.

Android Debug Bridge (ADB) is a command-line tool used for communicating with an Android device. ADB provides access to a Unix shell, allowing you to execute various commands on an Android device.

ADB has a range of commands that can be used to manage Android devices. ADB commands can be used for debugging, testing applications, installing and managing applications, accessing the device shell (a command-line interface that allows you to interact with the device’s operating system), transferring files, and customizing and automating device settings, system configurations, and application behaviors within the Android system. The commands can be of use for a wide range of applications including troubleshooting. The document describes how you can use ADB wirelessly and thus execute ADB commands on Android devices remotely from a host computer.

Components of ADB

ADB communicates with an Android device through three components: a host computer (client), a server, and a daemon. The client is the device from which commands are sent to the Android device, typically your host computer (supported on Mac, Windows, and Linux platforms). The daemon, running as a background process on the Android device, is responsible for executing the ADB commands received. The server maintains communication between the host computer (client) and the daemon. It runs as a background process on your host computer.

Setting up SDK Platform – Tools package

An ADB server is initiated whenever the host computer attempts to establish a connection between the client and the daemon. In order to establish a connection, you should download the latest version of the SDK Platform-Tools package on your host computer. Based on the OS of your host computer, you can choose from any one of the following options:

SDK platform tools package – Mac

SDK platform tools package – Linux

SDK platform tools package – Windows

Once the package files are downloaded, you can follow the steps under Connecting Android devices with ADB wirelessly to establish a wireless connection between the host computer and the Android device. When an ADB client is initiated, it checks for a running ADB server. If not found, it starts the server to manage the communication between the client and the daemon. The client sends commands, and the daemon executes those commands on the device. These commands can be executed from both the Mac Terminal application and the Windows Command Prompt.

Connecting Android devices with ADB wirelessly

Devices running Android 11 or newer can be connected via ADB wirelessly, without a USB connection. Follow these steps to establish a wireless connection:

Note:


To run ADB wirelessly, both the host computer and the Android device should be connected to the same Wi-Fi network.

  1. On the Android device, go to Settings > System > About phone and tap on the build number 7 times.
  2. Go to Settings > Developer Options and enable Wireless Debugging.
    To execute ADB commands on Android, enable wireless debugging from device settings and establish a connection
  3. Install ADB on your host computer.
  4. On the Android device, open the Wireless Debugging settings and tap on the Pair device with pairing code option.

Using a macOS host computer:

  1. Open terminal on your Mac, execute the following command.

    You can also obtain the file path of the SDK platform-tools directory by dragging and dropping the folder into the terminal.

  2. To pair the Android devices with your Mac wirelessly, execute the following command along with the IP address and port number shown by clicking on the Pair device with pairing code option.
    Paring with an Android device using a pairing code via Wireless debugging

    For example: ./adb pair 192.158.3.28:33458

  3. Press return to execute the command. You will notice a Currently connected status on your Android device determining a successful connection.

Using a Windows host computer:

While dealing with ADB via Windows devices, the only difference you can notice from Mac is that the ‘./’ is removed before running ADB commands in the Windows Command Prompt.

  1. Open the downloaded SDK tools folder and type “cmd” in the address bar (the place where the path to the currently selected folder is shown), then press Enter. This action will open the folder in the command line tool.
    SDK tools folder’s address bar replaced with cmd to open the folder to execute ADB commands on Android devices
  2. To pair the Android devices with your Windows device wirelessly, navigate to Settings > Developer Options > Wireless Debugging, then click on the Pair device with pairing code option.
  3. Execute the following command along with the IP address and port number shown in the Pair device with pairing code option.

    For example: adb pair 192.174.1.28:33557

  4. Enter the Wi-Fi pairing code and press Enter to complete the pairing process between your Android device and your Windows device. Once paired successfully, you will see a confirmation dialog on your Android device.
  5. After successful pairing, you can establish a connection to your Android device by executing the following command, containing the IP address and port number of the device. This information can be found under the Device name as “IP address and port” on the Wireless Debugging page.

    For example: adb pair 192.158.3.28:33458

  6. Press Enter to execute the command. You will notice a Currently connected status on your Android device determining a successful connection.

After establishing a successful connection, you can execute the following commands on your Android device remotely from your host computer:

Note:


Sometimes, the host computer may display an error message such as “A connection attempt failed because the connected party did not properly respond after a time period, or the established connection failed because the connected host has failed to respond.” In such cases, it is advisable to restart either the host computer or the connected device and then attempt the connection again after the restart.

Establishing server connection and managing Android devices remotely

It is essential to establish a proper connection between the host computer and the Android device to manage the device effectively. The following ADB commands can be executed from the host computer to maintain an efficient connection between the host computer and the device, and troubleshoot any connectivity issues:

Command Function Description
adb start-server Start the ADB server
  • To start the server to initiate communication between the client and the daemon.
  • This command can be used when you want to start managing your devices, or the device has lost connection due to a prolonged ideal time.
adb get-state Connectivity of the device To fetch the current connectivity state of the device with the ADB server.
adb get-serialno IP address and Port number To fetch the serial number of the connected Android device. The serial number of the device usually consists of a combination of the IP address and port number of the connected device.
adb devices List of connected devices To fetch the list of all the devices connected to your host computer via ADB.
adb devices -l List of connected devices along with their properties To fetch the list of all devices connected via ADB and their properties. These properties might include serial number, connectivity state, product name, device model, device type (emulator or device), etc.
adb usb List of devices connected via USB To fetch the list of all the devices connected to host computer with a USB connection via ADB.
adb –s “device serial number” “command” Execute device specific commands When multiple devices are connected, you might encounter the error ‘more than one emulator/device connected’. To avoid this, you should execute your commands targeting a specific device. This command allows you to execute commands on a particular device using its serial number.

For example: adb –s 192.175.39.34:45345 kill-server.

The above example will terminate the connection between the device and the host computer.

Reboot using ADB

When an Android device becomes stuck in an inoperable condition, it can be rebooted to restore its functionality. Android devices can be rebooted in different modes, such as fast boot or recovery mode, remotely via ADB. The following commands can be used to reboot the device via ADB:

Command Function Description
adb reboot bootloader Reboot in fastboot or bootloader mode To reboot the device and start it up in bootloader mode.
adb reboot recovery Reboot in recovery mode To reboot the device and boot it up in the recovery mode.
Note:


Recovery mode can be used to recover the OS of the device when the device’s OS is damaged.

adb reboot Reboot the device To reboot the device connected via ADB.

Monitoring Android device logs using ADB

The following commands can be used to fetch different types of logs that can be used to troubleshoot issues on Android devices via ADB:

Note:


To stop any currently ongoing process on terminal/command prompt while using ADB, press COMMAND+C (Mac) or CTRL+C (Windows).

Command Function Description
adb logcat Display logs To display the logs of the device connected via ADB on the host computer. These logs can be used to troubleshoot issues on the device.
adb logcat -d Save log data in a local file To save the log data of the device connected via ADB on the host computer in a location specified in the command.

For example: adb logcat -d > "C: /Users/username/Desktop/logfile.txt"

adb bugreport Generate bug report Generate a bug report of the device connected via ADB and save it on the host computer in the location specified in the command.

For example: adb bugreport > "/Users/username/Downloads/bugreports.txt"

adb logcat -c Clear log data Clear the log data up to the command execution time on the Android device connected via ADB.

Managing device attributes

ADB allows us to manage various software and hardware details related to battery, display, and battery status on an Android device using shell commands. This information can help in troubleshooting device issues. Moreover, it can be valuable for developers building and testing apps, as it helps them optimize their apps for different device configurations and battery capacities.

Note:


To stop any currently ongoing process on terminal/command prompt while using ADB, press COMMAND+C (Mac) or CTRL+C (Windows).

Command Function Description
adb shell top Monitor processes Monitor all the current running processes on the device connected via ADB.
adb shell pm list features List the features supported by the devices List all the hardware features supported by the Android device connected via ADB.
adb shell dumpsys display Display information Get detailed information regarding the display of the device connected via ADB.
adb shell dumpsys battery Battery information Get detailed battery information of the device connected via ADB.
adb shell dumpsys batterystats Battery stat information Get statistical battery information regarding its usage over the time for the device connected via ADB.
adb shell dumpsys battery set level X Set battery level Configure the battery level of the device and set it to a desired percentage between 0 to 100.

For example: adb shell dumpsys battery set level 10

The above example sets the battery percentage to a 10 percentage on the device.

Note:


Please be cautious while using this command. Setting the battery percentage to 0 might lead to device shut down.

adb shell dumpsys battery set status X Set battery status Configure the battery status of the device connected via ADB.
Battery status determines the current charging state of the device’s battery. You can find the battery status of the device in the battery settings.
Replace X in the command with “1, 2, 3, 4, 5, or 6”. Each value sets the battery status of the Android device to unknown, charging, discharging, not charging, charged, or connected-not charging. These values differ from one Android device to another.
adb shell dumpsys battery reset Reset battery settings Reset the battery settings back to their default state.

Directory management

Using ADB, you can manage directories and perform multiple shell commands on different directories. The following is the list of commands to manage directories via ADB:

Command Function Description
adb shell pwd Current directory To fetch the information about the current directory and display it on the host computer.
adb shell cd /'directory' Change directory To change the current working directory on the Android device.

For example: adb shell cd /system

The above example changes the directory to system.

adb shell ls List out directory content List out the contents in the directory and display them on the host computer.
adb shell ls -s Size of each file in the selected directory Fetch the size of each file in the selected directory and list them out in alphabetical order on the host computer.
adb shell ls -R List out the subdirectories List out all the subdirectories present under the selected directory and display them on the host computer

Application management

ADB provides essential commands for managing applications on Android devices. These commands can be used to perform tasks such as installing single or multiple applications, managing storage, and uninstalling applications smoothly.

Command Function Description
adb install 'application.apk' Deploy an application to device and install To deploy an application from the host computer to the devices connected via ADB.
Before executing the command make sure that the APK file of the application is present in the SDK Tools folder.

For example: adb install Microsoft-teams.apk

adb install-multiple 'application1.apk' 'application.apk' Deploy multiple applications to device and install To deploy multiple APK files from the host computer to the connected Android devices and install them sequentially using ADB.
Make sure that the APK files of the intended applications are present in SDK Tools folder.

For example: adb install-multiple Microsoft-teams.apk Google-Chrome.apk

adb install-multi-package <apkname.apk> <apkname2.apk> Deploy multiple applications to device and install all at once To deploy multiple applications from the host computer to the devices connected via ADB and install all of them at once.
Make sure that the APK files of the intended applications are present in SDK Tools folder.

For example: adb install-multi-package Microsoft-teams.apk Google-Chrome.apk

adb install -s <apkname.apk> Install an application in an external storage To deploy an APK file from the host computer to the devices connected via ADB and install them into the external storage of the device.

For example: adb install -s Microsoft-teams.apk

adb uninstall <apkname.apk> Uninstall an application using its package name To uninstall an application from the devices connected via ADB using their package names.

For example: adb uninstall com.microsoft.teams

Application management using shell commands

Through ADB, we can execute various supported shell commands on Android devices for remote management. Shell commands can be run by initiating a shell console with the ‘adb shell’ command and executing the necessary commands consecutively, or by combining the shell command with the ‘adb shell’ command line.
For example:

The command “adb shell netstat” is used to fetch network information of the connected device. Here are two ways to execute this command:

Type-1:

adb shell

netstat

In the above method, pressing enter after the command “adb shell” will initiate a shell console and you can execute a series of supported shell commands consecutively.

Type-2:
adb shell netstat

In this method, the command is executed in a shell console just for this command alone. This can be of help if you want to execute a minimal number of shell commands at once.

The table below illustrates how to manage applications on Android devices via ADB using shell commands.

Command Function Description
adb shell Start a remote shell console To initiate a shell console to execute shell commands on the devices connected via ADB.
adb shell pm list packages List out the package names of all installed applications To fetch the list of package names of all the applications installed on the device.
adb shell pm list packages -s List out the package names of system applications To fetch the list of package names of the system apps installed on the device.
adb shell pm list packages -3 List out the package names of third-party applications To fetch the list of package names of the third-party applications installed on the device.
adb shell pm list packages -u List out the package names of uninstalled applications To fetch the list of applications that were uninstalled from the device since the last factory reset.
adb shell pm list packages -d List out the package names of disabled applications To fetch the list of all the disabled applications on the device connected via ADB.
adb shell pm list packages -e List out the package names of enabled applications To fetch the list of all enabled applications on the device connected via ADB.
adb shell pm disable <package_name_of_apk> Disable an application using its package name To disable an application on the device using its package name.

For example: adb shell pm disable com.google.android.apps.photos

adb shell pm uninstall -k --user 0 <package_name_of_apk> Uninstall system application by a package name To uninstall a system application on the device using its package name.

For example: adb shell pm uninstall -k --user 0 com.google.android.youtube

adb shell pm clear <package_name_of_apk> Clear application data by package name To clear all the data that is associated with the application.
adb shell pm hide <package_name_of_apk> Hide application by package name To hide an application on the device connected via ADB using its package name.
adb shell pm unhide <package_name_of_apk> Unhide application by package name To unhide an application on the device connected via ADB using its package name.

Screen recording using ADB

Using ADB, we can initiate a screen capture or screen recording remotely. We can configure the resolution and bitrate of the screen recorded video. The following commands can help manage screen capture on Android devices via ADB:

Command Function Description
adb shell screencap "/path to save the file on the device along with the file name and extension/ " Take screenshot and save it Take a screenshot of the device’s screen during the command execution. Screenshots will be saved on the device at the location specified in the command.

For example: adb shell screencap /storage/emulated/0/DCIM/Camera/Screenshot.jpg

adb shell screenrecord "/path to save the file on the device along with the file name and extension/ " Record screen and save it Start the screen recording upon command execution. Screen recording will be saved on the device at the location specified in the command.
To stop screen recording, press CTRL+C/COMMAND+C.
Screen recording will be saved in the location specified in the command.

For example: adb shell screenrecord /storage/emulated/0/DCIM/movie.mp4

adb shell screenrecord --time-limit X "/path to save the file on the device along with the file name and extension/ " Record screen for specific duration Start the screen recording upon command execution and terminate it after completing the mentioned time interval. Screen recording will be saved on the device at the location specified in the command.
Replace ‘X’ with the desired number of seconds to set the recording duration in the command line.

For example: adb shell screenrecord –time-limit 8 /storage/emulated/0/DCIM/movie.mp4

The above example showcases the screen recording duration limit set to 8 seconds.

adb shell screenrecord --size widthxheight "/path to save the file on the device along with the file name and extension/ " Record screen with specific resolution Start screen recording upon command execution. Record screen with specified resolution and save the recording in the location specified in the command.

For example: adb shell screenrecord --size 480x640 /storage/emulated/0/DCIM/movie.mp4

Note:


The command accepts input in the ‘height x width’ format. However, for better results, it’s recommended to use the ‘width x height’ format for the resolution.

adb shell screenrecord --bit-rate 1500000 "/path to save the file on the device along with the file name and extension/ " Record screen with specific bitrate Start screen recording upon command execution. Set the video to the specified bitrate and save it in the location specified in the command.

For example: adb shell screenrecord --bit-rate 1500000 /storage/emulated/0/DCIM/movie.mp4

File management

Using ADB, file management can be performed swiftly and remotely. Tasks such as transferring files from the host computer to the managed device or vice versa, moving or copying files on the device internally, and creating or deleting folders can be performed easily. The following commands can be used for file/folder management via ADB:

Command Function Description
adb pull "/path to the file/ " Transfer a file from Android device to host computer Transfer a copy of file from the Android device’s storage to the SDK tools folder on the host computer.

For example: adb pull "/storage/emulated/0/DCIM/Camera/ADB_Commands.jpg"

adb push "path to the file on the host computer" "path to install the file on the Android device" Transfer a file from host computer to Android device Transfer a copy of a file from the host computer to a specific location on the Android device.

For example: adb push "C:/Users/username/Desktop/logfile.txt" "/storage/emulated/0/DCIM/Camera/"

adb shell cp /path of the file in source folder/ /path to the destination folder/ Copy files on the device internally Copy files from one folder to another folder inside the Android device storage.

For example: adb shell cp /storage/emulated/0/Download/images.jpeg /storage/emulated/0/DCIM/Camera/

adb shell mv /path of the file in source folder/ /path to the destination folder/ Move files on the device internally Move files from one folder to another folder inside the Android device storage.

For example: adb shell mv /storage/emulated/0/Download/images.jpeg /storage/emulated/0/DCIM/Camera/

adb shell rm -f "/path of the file on the device/ " Deleting a file Delete a file on the Android device connected via ADB.

For example: adb shell rm -f /storage/emulated/0/Download/images.jpeg

adb shell rm -r "/path of the folder on the device/ " Deleting a folder Delete a folder on the Android device connected via ADB.

For example: adb shell rm -r /storage/emulated/0/DCIM/Screenshots

adb shell mkdir "path to the folder on the device/ " Creating a folder Create a folder on a preferred location on the Android device connected via ADB.

For example: adb shell mkdir /storage/emulated/0/DCIM/Captures

Key events in ADB

Key events in ADB commands simulate the physical buttons on the device. Executing these commands allows you to virtually access the buttons of your Android device from your host computer. These commands use codes or names to mimic physical key presses, such as the home button or volume up button. Key event commands enable remote control of your device for tasks like app testing, automating actions, and even checking accessibility features.

For example, the following command can be used to press HOME button on the device:

Key events in ADB

This table lists key events and their corresponding shell commands for Android devices. Each command triggers a specific action, ranging from basic navigation to media controls, allowing for automation and remote control of Android devices via ADB.

Command Key
adb shell input keyevent 0 Unknown
adb shell input keyevent 1 Soft Left
adb shell input keyevent 2 Soft Right
adb shell input keyevent 3 Home
adb shell input keyevent 4 Back
adb shell input keyevent 5 Call
adb shell input keyevent 6 End Call
adb shell input keyevent 7 0
adb shell input keyevent 8 1
adb shell input keyevent 9 2
adb shell input keyevent 10 3
adb shell input keyevent 11 4
adb shell input keyevent 12 5
adb shell input keyevent 13 6
adb shell input keyevent 14 7
adb shell input keyevent 15 8
adb shell input keyevent 16 9
adb shell input keyevent 17 Star
adb shell input keyevent 18 Pound
adb shell input keyevent 19 Dpad Up
adb shell input keyevent 20 Dpad Down
adb shell input keyevent 21 Dpad Left
adb shell input keyevent 22 Dpad Right
adb shell input keyevent 23 Dpad Center
adb shell input keyevent 24 Volume Up
adb shell input keyevent 25 Volume Down
adb shell input keyevent 26 Power
adb shell input keyevent 27 Camera
adb shell input keyevent 28 Clear
adb shell input keyevent 29 A
adb shell input keyevent 30 B
adb shell input keyevent 31 C
adb shell input keyevent 32 D
adb shell input keyevent 33 E
adb shell input keyevent 34 F
adb shell input keyevent 35 G
adb shell input keyevent 36 H
adb shell input keyevent 37 I
adb shell input keyevent 38 J
adb shell input keyevent 39 K
adb shell input keyevent 40 L
adb shell input keyevent 41 M
adb shell input keyevent 42 N
adb shell input keyevent 43 O
adb shell input keyevent 44 P
adb shell input keyevent 45 Q
adb shell input keyevent 46 R
adb shell input keyevent 47 S
adb shell input keyevent 48 T
adb shell input keyevent 49 U
adb shell input keyevent 50 V
adb shell input keyevent 51 W
adb shell input keyevent 52 X
adb shell input keyevent 53 Y
adb shell input keyevent 54 Z
adb shell input keyevent 55 Comma
adb shell input keyevent 56 Period
adb shell input keyevent 57 Alt Left
adb shell input keyevent 58 Alt Right
adb shell input keyevent 59 Shift Left
adb shell input keyevent 60 Shift Right
adb shell input keyevent 61 Tab
adb shell input keyevent 62 Space
adb shell input keyevent 63 Sym
adb shell input keyevent 64 Explorer
adb shell input keyevent 65 Envelope
adb shell input keyevent 66 Enter
adb shell input keyevent 67 Del
adb shell input keyevent 68 Grave
adb shell input keyevent 69 Minus
adb shell input keyevent 70 Equals
adb shell input keyevent 71 Left Bracket
adb shell input keyevent 72 Right Bracket
adb shell input keyevent 73 Backslash
adb shell input keyevent 74 Semicolon
adb shell input keyevent 75 Apostrophe
adb shell input keyevent 76 Slash
adb shell input keyevent 77 At
adb shell input keyevent 78 Num
adb shell input keyevent 79 Headsethook
adb shell input keyevent 80 Focus
adb shell input keyevent 81 Plus
adb shell input keyevent 82 Menu
adb shell input keyevent 83 Notification
adb shell input keyevent 84 Search
adb shell input keyevent 85 Media Play Pause
adb shell input keyevent 86 Media Stop
adb shell input keyevent 87 Media Next
adb shell input keyevent 88 Media Previous
adb shell input keyevent 89 Media Rewind
adb shell input keyevent 90 Media Fast Forward
adb shell input keyevent 91 Mute
adb shell input keyevent 92 Page Up
adb shell input keyevent 93 Page Down
adb shell input keyevent 94 Pictsymbols
adb shell input keyevent 95 Switch Charset
adb shell input keyevent 96 Button A
adb shell input keyevent 97 Button B
adb shell input keyevent 98 Button C
adb shell input keyevent 99 Button X
adb shell input keyevent 100 Button Y
adb shell input keyevent 101 Button Z
adb shell input keyevent 102 Button L1
adb shell input keyevent 103 Button R1
adb shell input keyevent 104 Button L2
adb shell input keyevent 105 Button R2
adb shell input keyevent 106 Button Thumbl
adb shell input keyevent 107 Button Thumbr
adb shell input keyevent 108 Button Start
adb shell input keyevent 109 Button Select
adb shell input keyevent 110 Button Mode
adb shell input keyevent 111 Escape
adb shell input keyevent 112 Forward Del
adb shell input keyevent 113 Ctrl Left
adb shell input keyevent 114 Ctrl Right
adb shell input keyevent 115 Caps Lock
adb shell input keyevent 116 Scroll Lock
adb shell input keyevent 117 Meta Left
adb shell input keyevent 118 Meta Right
adb shell input keyevent 119 Function
adb shell input keyevent 120 Sysrq
adb shell input keyevent 121 Break
adb shell input keyevent 122 Move Home
adb shell input keyevent 123 Move End
adb shell input keyevent 124 Insert
adb shell input keyevent 125 Forward
adb shell input keyevent 126 Media Play
adb shell input keyevent 127 Media Pause
adb shell input keyevent 128 Media Close
adb shell input keyevent 129 Media Eject
adb shell input keyevent 130 Media Record
adb shell input keyevent 131 F1
adb shell input keyevent 132 F2
adb shell input keyevent 133 F3
adb shell input keyevent 134 F4
adb shell input keyevent 135 F5
adb shell input keyevent 136 F6
adb shell input keyevent 137 F7
adb shell input keyevent 138 F8
adb shell input keyevent 139 F9
adb shell input keyevent 140 F10
adb shell input keyevent 141 F11
adb shell input keyevent 142 F12
adb shell input keyevent 143 Num Lock
adb shell input keyevent 144 Numpad 0
adb shell input keyevent 145 Numpad 1
adb shell input keyevent 146 Numpad 2
adb shell input keyevent 147 Numpad 3
adb shell input keyevent 148 Numpad 4
adb shell input keyevent 149 Numpad 5
adb shell input keyevent 150 Numpad 6
adb shell input keyevent 151 Numpad 7
adb shell input keyevent 152 Numpad 8
adb shell input keyevent 153 Numpad 9
adb shell input keyevent 154 Numpad Divide
adb shell input keyevent 155 Numpad Multiply
adb shell input keyevent 156 Numpad Subtract
adb shell input keyevent 157 Numpad Add
adb shell input keyevent 158 Numpad Dot
adb shell input keyevent 159 Numpad Comma
adb shell input keyevent 160 Numpad Enter
adb shell input keyevent 161 Numpad Equals
adb shell input keyevent 162 Numpad Left Paren
adb shell input keyevent 163 Numpad Right Paren
adb shell input keyevent 164 Volume Mute
adb shell input keyevent 165 Info
adb shell input keyevent 166 Channel Up
adb shell input keyevent 167 Channel Down
adb shell input keyevent 168 Zoom In
adb shell input keyevent 169 Zoom Out
adb shell input keyevent 170 TV
adb shell input keyevent 171 Window
adb shell input keyevent 172 Guide
adb shell input keyevent 173 DVR
adb shell input keyevent 174 Bookmark
adb shell input keyevent 175 Captions
adb shell input keyevent 176 Settings
adb shell input keyevent 177 TV Power
adb shell input keyevent 178 TV Input
adb shell input keyevent 179 STB Power
adb shell input keyevent 180 STB Input
adb shell input keyevent 181 AVR Power
adb shell input keyevent 182 AVR Input
adb shell input keyevent 183 Prog Red
adb shell input keyevent 184 Prog Green
adb shell input keyevent 185 Prog Yellow
adb shell input keyevent 186 Prog Blue
adb shell input keyevent 187 App Switch
adb shell input keyevent 188 Button 1
adb shell input keyevent 189 Button 2
adb shell input keyevent 190 Button 3
adb shell input keyevent 191 Button 4
adb shell input keyevent 192 Button 5
adb shell input keyevent 193 Button 6
adb shell input keyevent 194 Button 7
adb shell input keyevent 195 Button 8
adb shell input keyevent 196 Button 9
adb shell input keyevent 197 Button 10
adb shell input keyevent 198 Button 11
adb shell input keyevent 199 Button 12
adb shell input keyevent 200 Button 13
adb shell input keyevent 201 Button 14
adb shell input keyevent 202 Button 15
adb shell input keyevent 203 Button 16
adb shell input keyevent 204 Language Switch
adb shell input keyevent 205 Manner Mode
adb shell input keyevent 206 3D Mode
adb shell input keyevent 207 Contacts
adb shell input keyevent 208 Calendar
adb shell input keyevent 209 Music
adb shell input keyevent 210 Calculator
adb shell input keyevent 211 Zenkaku Hankaku
adb shell input keyevent 212 Eisu
adb shell input keyevent 213 Muhenkan
adb shell input keyevent 214 Henkan
adb shell input keyevent 215 Katakana Hiragana
adb shell input keyevent 216 Yen
adb shell input keyevent 217 Ro
adb shell input keyevent 218 Kana
adb shell input keyevent 219 Assist
adb shell input keyevent 220 Brightness Down
adb shell input keyevent 221 Brightness Up
adb shell input keyevent 222 Media Audio Track
adb shell input keyevent 223 Sleep
adb shell input keyevent 224 Wakeup
adb shell input keyevent 225 Pairing
adb shell input keyevent 226 Media Top Menu
adb shell input keyevent 227 11
adb shell input keyevent 228 12
adb shell input keyevent 229 Last Channel
adb shell input keyevent 230 TV Data Service
adb shell input keyevent 231 Voice Assist
adb shell input keyevent 232 TV Radio Service
adb shell input keyevent 233 TV Teletext
adb shell input keyevent 234 TV Number Entry
adb shell input keyevent 235 TV Terrestrial Analog
adb shell input keyevent 236 TV Terrestrial Digital
adb shell input keyevent 237 TV Satellite
adb shell input keyevent 238 TV Satellite BS
adb shell input keyevent 239 TV Satellite CS
adb shell input keyevent 240 TV Satellite Service
adb shell input keyevent 241 TV Network
adb shell input keyevent 242 TV Antenna Cable
adb shell input keyevent 243 TV Input HDMI 1
adb shell input keyevent 244 TV Input HDMI 2
adb shell input keyevent 245 TV Input HDMI 3
adb shell input keyevent 246 TV Input HDMI 4
adb shell input keyevent 247 TV Input Composite 1
adb shell input keyevent 248 TV Input Composite 2
adb shell input keyevent 249 TV Input Component 1
adb shell input keyevent 250 TV Input Component 2
adb shell input keyevent 251 TV Input VGA 1
adb shell input keyevent 252 TV Audio Description
adb shell input keyevent 253 TV Audio Description Mix Up
adb shell input keyevent 254 TV Audio Description Mix Down
adb shell input keyevent 255 TV Zoom Mode
adb shell input keyevent 256 TV Contents Menu
adb shell input keyevent 257 TV Media Context Menu
adb shell input keyevent 258 TV Timer Programming
adb shell input keyevent 259 Help
adb shell input keyevent 260 Navigate Previous
adb shell input keyevent 261 Navigate Next
adb shell input keyevent 262 Navigate In
adb shell input keyevent 263 Navigate Out
adb shell input keyevent 264 Stem Primary
adb shell input keyevent 265 Stem 1
adb shell input keyevent 266 Stem 2
adb shell input keyevent 267 Stem 3
adb shell input keyevent 268 DPad Up Left
adb shell input keyevent 269 DPad Down Left
adb shell input keyevent 270 DPad Up Right
adb shell input keyevent 271 DPad Down Right
adb shell input keyevent 272 Media Skip Forward
adb shell input keyevent 273 Media Skip Backward
adb shell input keyevent 274 Media Step Forward
adb shell input keyevent 275 Media Step Backward
adb shell input keyevent 276 Soft Sleep
adb shell input keyevent 277 Cut
adb shell input keyevent 278 Copy
adb shell input keyevent 279 Paste
adb shell input keyevent 280 System Navigation Up
adb shell input keyevent 281 System Navigation Down
adb shell input keyevent 282 System Navigation Left
adb shell input keyevent 283 System Navigation Right
adb shell input keyevent 284 All Apps
adb shell input keyevent 285 Refresh

Disconnecting Android devices from ADB

To terminate the ADB server and halt the communication between the host computer (client) and the daemon, execute the following command to the Android device from your host computer:

The above command can be used to disconnect the Android device from the ADB server after you are done managing the device.

Note:


Make sure to turn off Wireless debugging on the Android device after disconnecting it from the ADB server, as it could lead to unauthorized access to your device.

  • Troubleshooting Guides