ADB Tool

Install ADB Tool

Install the ADB tool on PC Host:

1
2
$ sudo apt-get update
$ sudo apt-get install android-tools-adb

Add permission and configuration files

Add permission and configuration details after installation.

Add permission

1
$ sudo  useradd -G plugdev $USER

Write configuration files

Create a .rules file:

1
$ sudo vim /etc/udev/rules.d/51-android.rules

Write the following to the .rules file:

1
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", MODE="0666"

Restart udev service

1
$ sudo /etc/init.d/udev restart

Install ADB Tool

  • Regfer this guide to install the USB driver.
  • Download the Platform Tools.
  • Unzip the Platform Tools file to the easily accessible directory, such as C:\platform-tools.
Note
  • When executing the adb command in the cmd terminal, you need to enter the C:\platform-tools directory, otherwise it will prompt that the adb command cannot be found.

Use ADB

ADB over Wi-Fi/LAN

  • Ensure that either Wi-Fi or LAN is connected

  • Enable ADB debugging on your SBC: Settings-->Developer options-->USB debugging

  • Check the IP address of your SBC: Settings-->About device-->Status-->IP

  • Run the adb connect command:

    1
    2
    $ adb connect 192.168.1.120
    $ adb shell

ADB over USB

  • Ensure that a USB-C cable is connected between your PC and SBC

  • Enable ADB debugging on your SBC: Settings-->Developer options-->USB debugging

  • Open a Terminal and type:

    1
    $ adb shell

Links

Note
  • If you android device is a phone, you must enable developer mode
  • When you try to debug your Android device with adb devices, a notification will appear that you must accept
  • If your Android device is a Khadas SBC, developer mode is enabled by default