Skip to main content

ADB - Quick Reference Guide

⚠️ Note: Make sure your device has USB Debugging enabled and that it is authorized to connect via ADB.


🔄 Restart ADB Server

adb kill-server
adb start-server

🔁 Device Rebooting

Reboot the device
adb reboot
Reboot the device into recovery mode (for upgrading or downgrading devices)
adb reboot recovery

🔧 Common Device Controls

info

To simulate physical button presses, use the command adb shell input keyevent <KEYCODE>.

Common examples include:

  • 3KEYCODE_HOME
  • 26KEYCODE_POWER
  • 82KEYCODE_MENU (often used to unlock the screen)

You can find the full list of keycodes in the official Android KeyEvent reference.

adb shell input keyevent 3      # Home (KEYCODE_HOME)
adb shell input keyevent 26 # Power (KEYCODE_POWER)
adb shell input keyevent 82 # Unlock (KEYCODE_MENU)
adb shell input keyevent KEYCODE_WAKEUP # Wake up the device
adb shell input text 'HelloWorld' # Send a string of characters
adb shell input tap 487 428 # Example: tap at coordinates (487,428)
# You can find X and Y coordinates by enabling 'Pointer location' in Developer Options on the device.
adb shell input swipe 356 1257 356 100 # Swipe from bottom to top
# Format: swipe <x1> <y1> <x2> <y2> [duration_ms]
# Example: swipe from (356,1257) to (356,100) over 300ms (default)

⚙️ Device Configuration

adb shell am start -a android.settings.SETTINGS     # Open Settings
adb shell settings get global device_name # Get the device name
adb shell settings put global device_name "Device_XXX" # Put the device name
adb shell settings put system screen_brightness 125 # Setting the device brightness
adb shell settings put global stay_on_while_plugged_in 3 # Enable Stay awake
adb shell settings put global stay_on_while_plugged_in 0 # Disable Stay awake
📴 Allow applications from unknown sources
Security Warning

Enabling this setting allows installation of apps from outside the Play Store. Make sure the APKs come from trusted sources.

adb shell settings put secure install_non_market_apps 1     # Android 8.0+
adb shell cmd package set-home-activity com.example.launcher/.MainActivity
🔉 Sound levels
adb shell settings put system volume_music_speaker 0
adb shell settings put system volume_notification_speaker 0
adb shell settings put system volume_ring_speaker 0
adb shell settings put system volume_system_speaker 0
🔗 Screen rotation
adb shell settings put system accelerometer_rotation 0  # accelerometer_rotation: auto-rotation, 0 disable, 1 enable
adb shell settings put system user_rotation 3 # user_rotation: actual rotation, clockwise, 0 0°, 1 90°, 2 180°, 3 270°
🇫🇷 Device language
info

A device reboot is needed

adb shell settings get system system_locales
adb shell settings put system system_locales fr-FR
👀 Disable USB Debugging mode
Security Warning

The enable command has no sense. You cannot send ADB commands to the terminal if the Debug mode is disabled

adb shell settings put global adb_enabled 0
🏠 MDM Default HOME

The "home app" must be installed and active

adb shell cmd package set-home-activity com.telelogos.mediacontact/com.telelogos.mckiosk.McKioskActivity
🎹 Keyboard management
adb shell settings get secure default_input_method      # Get the current keyboard
adb shell ime list -s # List of available keyboards
adb shell ime enable com.android.inputmethod.latin/.LatinIME
adb shell ime set com.android.inputmethod.latin/.LatinIME
adb shell ime disable com.android.inputmethod.latin/.LatinIME

🚫 Disable System Updates

To prevent Android from downloading security or system updates:

adb shell settings put system security_update_db 0
adb shell settings put system SOFTWARE_UPDATE_WIFI_ONLY2 0
Security Warning

Caution: Disabling updates may expose your device to security risks. Use only in controlled environments.


🌐 Connectivity

⏰ NTP server

NTP server not present in all platforms

adb shell settings get global ntp_server
adb shell settings put global ntp_server ntp1.example.net
🌐 WiFi Control & Status
  • Get Wi-Fi status:
adb shell "dumpsys wifi | grep 'Wi-Fi is'"
  • Enable / Disable Wi-Fi:
adb shell svc wifi enable
adb shell svc wifi disable
  • Open Wi-Fi settings:
adb shell am start -a android.settings.WIRELESS_SETTINGS
  • Get detailed Wi-Fi status:
adb shell dumpsys wifi | grep "mNetworkInfo"
  • "CONNECTED/CONNECTED" → Connected to a valid network
  • "DISCONNECTED/SCANNING" → Wi-Fi is on but not connected
  • "DISCONNECTED/DISCONNECTED" → Wi-Fi is off
📶 Bluetooth Control
  • Get Bluetooth status:
adb shell settings get global bluetooth_on
  • Enable / Disable Bluetooth:
adb shell settings put global bluetooth_on 1
adb shell settings put global bluetooth_on 0
  • Prompt user to enable / disable:
adb shell am start -a android.bluetooth.adapter.action.REQUEST_ENABLE
adb shell am start -a android.bluetooth.adapter.action.REQUEST_DISABLE

⚠️ A device reboot may be required for persistent change.

📡 NFC Toggle
  • Check NFC status:
adb shell dumpsys nfc
  • Enable / Disable NFC:
adb shell svc nfc enable
adb shell svc nfc disable

Or using service calls:

adb shell service call nfc 7   # Enable
adb shell service call nfc 6 # Disable
🛡️ Google Play Protect
  • Check Play Protect status:
adb shell settings get global package_verifier_user_consent
  • Enable / Disable:
adb shell settings put global package_verifier_user_consent 1
adb shell settings put global package_verifier_user_consent -1

🧾 Get Device Info

adb shell getprop ro.build.version.release      # Get Android version
adb shell getprop ro.build.display.id # Get Build number
adb shell getprop ro.device.patch.version # Get Patch number
adb shell settings get secure bluetooth_address # Get BT MAC address
adb shell ip addr show wlan0 | grep 'inet ' | cut -d ' ' -f 6 | cut -d / -f 1 # Get IP address

📁 File Management

adb push local.txt /sdcard/     # Copy from the local source to the device
# Format: push <local path> <device path>
adb pull /sdcard/file.txt . # Copy from the device to the local source
# Format: pull <device path> <local path>
adb shell rm /sdcard/file.txt # Delete a file
adb shell mkdir "/sdcard/ExampleDir/" > NUL # Create a directory
adb shell rmdir "/sdcard/ExampleDir/" # Delete a directory

📝 Logcat

adb logcat -c       # Clear logcat (all log buffers)
adb logcat -f log.txt # Dump logs to a file on your local machine
Debugging Tip

Use adb logcat -s <tag>:V *:S to filter logs by a specific tag (e.g., BTPairing, TellNext, Calibrate, SpeakerNext, EVAPlayer)

📌 Examples

Print only BTPairing and TellNext logs (verbose):

adb logcat BTPairing:V TellNext:V *:S

Print logs for VoiXtreme and NUANCE engines:

adb logcat VoiXtreme:V NUANCE:V *:S
💾 Logcat Buffer Management
adb logcat -g   # Check current buffer size
adb logcat -G 16M # Set buffer size (e.g., 16 MB)
🛠️ Activate Specific Log Tags

If logs are not showing (e.g., after reboot), you may need to re-enable a specific tag:

adb shell setprop log.tag.<MyAppTag> DEBUG

📌 Example

Enable log output for SpeakerNext:

adb shell setprop log.tag.SpeakerNext DEBUG

📦 Devices

🧿 List Bonded (Paired) Bluetooth Devices

To identify the system service responsible for Bluetooth, run:

adb shell "dumpsys -l | grep bluetooth"

This will return the service name related to Bluetooth (usually bluetooth_manager or similar), useful for diagnostics or deeper inspection.

To list all devices that are bonded (i.e., previously paired) with the Android device:

adb shell "dumpsys bluetooth_manager | sed -n '/Bonded devices:/,/^$/p'"

This command extracts only the portion of the output that includes bonded devices.

📌 Example Output

Bonded devices:
Device: 00:11:22:33:44:55 Name: SpeakerXYZ
Device: AA:BB:CC:DD:EE:FF Name: Headset123

💡 You can combine this with adb shell dumpsys bluetooth_manager | grep -i <device_name_or_mac> to filter results.


📦 App Management

adb install myapp.apk
adb shell pm install -g "/sdcard/application.apk" --user all # Installs an apk with all permissions grantes for all users
adb shell pm list packages # List installed packages
adb shell pm list packages -3 # List installed 3rd-party packages
adb shell dumpsys window windows | grep mCurrentFocus # Find the app currently on screen
🚀 Launch an App
  1. Get the ActivityName of the app:
adb shell dumpsys package <packageName> | grep Activity
  1. Start the app using:
adb shell am start -n <ActivityName>

📌 Example – Launch BT Pairing

adb shell dumpsys package com.tellnext.bluetooth_pairing | grep Activity
adb shell am start -n com.tellnext.bluetooth_pairing/com.tellnext.StarterActivity
♿ Accessibility Services
  • Enable Service
  1. Find the service name:
adb shell dumpsys package <packageName>
  1. Enable it:
adb shell settings put secure enabled_accessibility_services <serviceName>

📌 Example – Enable BT Pairing Service

adb shell settings put secure enabled_accessibility_services com.tellnext.bluetooth_pairing/com.tellnext.accessibility_service.BTAccessibilityService

💡 If enabling multiple services, separate them with a colon ::

adb shell settings put secure enabled_accessibility_services service1:service2
  • Disable Accessibility by Stopping App
adb shell am force-stop <packageName>
❌ Kill an App
adb shell am force-stop <packageName>

📌 Example – Kill BT Pairing

adb shell am force-stop com.tellnext.bluetooth_pairing
🔔 Notifications
  • Disable notifications:
adb shell cmd appops set <packageName> POST_NOTIFICATION ignore
  • Enable notifications:
adb shell cmd appops set <packageName> POST_NOTIFICATION allow

📌 Example

adb shell cmd appops set com.google.android.talk POST_NOTIFICATION ignore
✅ Grant Specific Permissions
adb shell cmd appops set <packageName> <permission> allow

📌 Example

adb shell cmd appops set com.telelogos.mediacontact WRITE_EXTERNAL_STORAGE allow
🔐 Set Device Owner / Admin
adb shell dpm set-active-admin com.telelogos.mediacontact/.McDeviceAdminReceiver
adb shell dpm set-device-owner com.telelogos.mediacontact/.McDeviceAdminReceiver
  • set-active-admin: Activates admin rights for a component
  • set-device-owner: Makes app the device owner
  • set-profile-owner: Assigns profile owner for a user
⏳ Wait for an Activity to Appear

Example using batch scripting to wait for a specific screen (e.g., KLMS confirmation):

:WAITING_FOR_KLMS
SET KMLS_ACTION=0
echo "---- PENDING ACTION BEFORE KLMS SCREEN APPEARS -----"
timeout /t 1 > NUL
for /f "delims=" %%i in ('%adb% shell "dumpsys activity activities | grep -c \".activities.ConfirmDialog\""') do Set KMLS_ACTION=%%i
if %KMLS_ACTION% EQU 0 (goto WAITING_FOR_KLMS)

🦓 Zebra devices

Identify MC33 keypad model
adb shell getprop ro.config.device.keyboard

*Possible responses: 7 (29-key device) / 6 (38-key device) / 5 (47-key device)


🍯 Honeywell devices

Identify CK65 keypad model
adb shell getprop ro.hon.plat.keypad

📌 Example

adb shell getprop ro.hon.plat.keypad
qwerty

*Possible responses: qwerty (51-key alpha) / numeric (38-key numeric)