===== Use adb ===== Android Debug Bridge (''adb'') is a versatile command-line tool that lets you communicate with a device. ==== Install adb tool ==== Install the ''adb'' tool on PC Host: ```shell 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** ```shell sudo useradd -G plugdev $USER ``` **Write configuration files** Create a .rules file: ```shell sudo vim /etc/udev/rules.d/51-android.rules ``` Write the following to the .rules file: ```shell SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", MODE="0666" ``` **Restart udev service** ```shell sudo /etc/init.d/udev restart ``` * Download and install the USB driver * VIM1/2/3/3L/4/1S * Download the [[dl>products/vim4/tool/usb-driver.zip | USB driver]] and extract it to somewhere. * Double click ''dpscat.exe'' to install the driver. Please note there is no GUI display. * Double click ''dpinst64.exe'' to install the driver. * Edge1/2 * Download the [[dl>products/edge2/tool/driver-assitant_v5.13.zip | USB driver]] and extract it to somewhere. * Double click ''DriverInstall.exe'' to install the driver. * Download the [[https://dl.google.com/android/repository/platform-tools-latest-windows.zip|platform tools]] * Unzip the platform tools file to the easily accessible directory, such as C:\platform-tools 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: ```shell 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: ```shell adb shell ``` *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