Zero/dev/adb
Radxa Zero > Development > Using ADB
Contents
Description
Radxa Zero supports Android Debug Bridge (adb), so you can open a shell or send file directly to Radxa Zero when network connection is not available.
One USB Type-C charging data cable can provide power while access the device in adb mode.
Here we use a Type-C to Type-A USB cable with Type-C end plugged in the power port of Radxa Zero, while the other end plugged into our computer.
Radxa Zero Software Requirement
- Kernel package version: >= 5.10.69-6-amlogic
- amlogic-adbd package version: >=0.1
Software Installation
Please follow those guides to install adb on your Windows or Linux computer.
Common adb Usage
Below are some commonly used adb commands:
Check adb devices
radxa@x86-64:~$ adb devices List of devices attached 0123456789ABCDEF device
Launch a root shell
radxa@x86-64:~$ adb shell #
To use bash shell, simply run /bin/bash
:
radxa@x86-64:~$ adb shell # /bin/bash root@zero:/#
Send file from PC to Radxa Zero
$ adb push <local path> <remote path>
Example:
radxa@x86-64:~$ adb push /tmp/meet-radxa-zero.md /home/rock /tmp/meet-radxa-zero.md: 1 file pushed. 0.0 MB/s (27 bytes in 0.001s) radxa@x86-64:~$ adb shell # cat /home/rock/meet-radxa-zero.md How do you do! Radxa Zero!
Send files from Radxa Zero to PC
$ adb pull <remote path> <local path>
Example:
radxa@x86-64:~$ adb pull /home/rock/meet-pc.md /tmp /home/rock/meet-pc.md: 1 file pulled. 0.0 MB/s (24 bytes in 0.001s) radxa@x86-64:~$ cat /tmp/meet-pc.md How do you do! Host PC!
Usage of amlogic-adbd service
To use above adb commands, you need to have amlogic-adbd service running on your Radxa Zero. Below are some common service management command:
Start amlogic-adbd service:
$ sudo systemctl start amlogic-adbd
Stop amlogic-adbd service:
$ sudo systemctl stop amlogic-adbd
Reload amlogic-adbd service:
$ sudo systemctl reload amlogic-adbd
or
$ sudo systemctl restart amlogic-adbd
Enable amlogic-adbd service auto-start at boot:
$ sudo systemctl enable amlogic-adbd
Disable amlogic-adbd service auto-start at boot:
$ sudo systemctl disable amlogic-adbd