Skip to main content

Key ADB Command Usage for Debugging

Installing ADB

Expand installation steps

Mac

Install adb with Homebrew. If you install manually, you must configure environment variables yourself.

  1. Install Homebrew first.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  1. Install adb with Homebrew.
brew install android-platform-tools
  1. Verify the installation.
adb version

If adb is not recognized as a runnable program, check that the adb path is included in the PATH environment variable.

Windows

  1. Install adb using Chocolatey or Winget.
Using Chocolatey
choco install adb
Using Winget
winget install Google.AndroidSDKPlatformTools
  1. Verify the installation.
adb version

Linux

Ubuntu / Debian family

  1. Install adb with the apt package manager.
sudo apt update
sudo apt install android-tools-adb android-tools-fastboot
  1. Verify the installation.
adb version

ADB connection and device check

This command lists attached devices. If no serial appears, try reconnecting.

Command
adb devices
Sample output
List of devices attached
emulator-5554 device

CCS connection

These commands link the device to the service. Use them to connect to Bluelink, Genesis Connected Services, and similar offerings.

adb shell settings put secure hmg_is_ccs_account_linked 1
adb shell settings put global hmg_provisioning_status 4

Screen capture

Captures a screenshot from the connected device. The file is saved on the desktop as screen_<timestamp>.png.

adb exec-out screencap -p > ~/Desktop/screen_$(date +"%Y%m%d_%H%M%S").png

Screen recording

Records the device screen while connected.

  1. Install a tool to package video (e.g. ffmpeg).
Example on Mac
brew install ffmpeg
  1. Start recording
adb exec-out screenrecord --output-format=h264 - > ~/Desktop/screen.h264
  1. Stop recording In the same terminal where recording is running, press Ctrl+C to stop.

  2. Convert format Repackage the H.264 stream into an MP4 container. After this step you can play the capture on your PC.

Example on Mac/Linux
ffmpeg -framerate 60 -i ~/Desktop/screen.h264 -c copy ~/Desktop/screen_$(date +"%Y%m%d_%H%M%S").mp4

Install / run / stop / uninstall apps

Install an app

Installs the APK.

adb install -d -r [path-to-apk]
# adb install -d -r app-my-signed.apk

Options
-d: Allow version downgrade
-r: Remove local data

If the command above fails, try:

adb push [path-to-apk] /data/local/tmp/
adb shell pm install -d -r /data/local/tmp/[apk-file-name]

# adb push app-my-signed.apk /data/local/tmp/
# adb shell pm install -d -r /data/local/tmp/app-my-signed.apk

Launch an app

Find the package, then start the app.

Find package
adb shell pm list packages | grep [partial-package-name]
# adb shell pm list packages | grep radioline
Launch app: 1) Via launcher
adb shell monkey -p [package-name] -c android.intent.category.LAUNCHER 1
# adb shell monkey -p ai.umos.appmarket -c android.intent.category.LAUNCHER 1
  • Behaves similarly to choosing the app from the Global Navigation Bar (GNB).
Launch app: 2) Start activity directly
adb shell am start -n [package-name]/[activity-path]
# adb shell am start -n com.radioline.android.radioline/.MainActivity

Uninstall an app

Removes the app. After uninstalling, clear the package data if needed.

Uninstall app
adb uninstall [package-name]
# adb uninstall ai.umos.appmarket
Clear app data
adb shell pm clear [package-name]
# adb shell pm clear ai.umos.appmarket

Force-stop an app

Force-stops the app process.

Force-stop app
adb shell am force-stop [package-name]
# adb shell am force-stop ai.umos.appmarket

UI text input

Sends text into the focused field on the emulator or device.

Text input
adb shell input text "[text]"
# adb shell input text "test"

Change gear state

Injects gear-related VHAL events.

Gear — P
adb shell dumpsys activity service com.android.car inject-vhal-event 0x11400400 4
Gear — R
adb shell dumpsys activity service com.android.car inject-vhal-event 0x11400400 2
Gear — N
adb shell dumpsys activity service com.android.car inject-vhal-event 0x11400400 3
Gear — D
adb shell dumpsys activity service com.android.car inject-vhal-event 0x11400400 8

The gear indicator in Driving view may not update visually, but the underlying gear state value is affected.

Enable / disable driving restrictions

Step-by-step commands to turn driving restrictions on and off. Commands differ by device—use the section that matches your hardware.

Connect-W

  • Enable driving restrictions

Run the following two steps.

  1. Set vehicle speed above 5 km/h (hold 30 m/s for 20 seconds)
adb shell dumpsys activity service com.android.car inject-vhal-event 0x11600207 30 -t 20
  1. Parking brake — Off / Gear — not P
adb shell dumpsys activity service com.android.car inject-vhal-event 0x11200402 "false"
adb shell dumpsys activity service com.android.car inject-vhal-event 0x11400400 8
  • Disable driving restrictions

Run these two steps to clear the state you enabled.

  1. Set vehicle speed to 0 km/h
adb shell dumpsys activity service com.android.car inject-vhal-event 0x11600207 0
  1. Parking brake — On / Gear — P
adb shell dumpsys activity service com.android.car inject-vhal-event 0x11200402 "true"
adb shell dumpsys activity service com.android.car inject-vhal-event 0x11400400 4

Connect-S/L

ICE (internal combustion)

  • Enable driving restrictions
adb shell dumpsys activity service com.android.car inject-vhal-event 0x21408A93 1
adb shell dumpsys activity service com.android.car inject-vhal-event 0x11600207 30 -t 60
  • Disable driving restrictions
adb shell dumpsys activity service com.android.car inject-vhal-event 0x21408A93 0

HEV (hybrid)

  • Enable driving restrictions
adb shell dumpsys activity service com.android.car inject-vhal-event 0x21408209 1
adb shell dumpsys activity service com.android.car inject-vhal-event 0x11600207 30 -t 60
  • Disable driving restrictions
adb shell dumpsys activity service com.android.car inject-vhal-event 0x21408209 0

EV (electric vehicle)

  • Enable driving restrictions
adb shell dumpsys activity service com.android.car inject-vhal-event 0x214081A4 1
adb shell dumpsys activity service com.android.car inject-vhal-event 0x11600207 30 -t 60
  • Disable driving restrictions
adb shell dumpsys activity service com.android.car inject-vhal-event 0x214081A4 0

Change mode

Switches to utility mode.

Run utility-mode commands only after establishing vehicle speed 0, parking brake on, and gear P.

adb shell echo -e -n "\x83\x50\x10\x00\x00\x02\xAA\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00" > /dev/vcs_simulator_rx