Difference between revisions of "Zero/dev/adb"
RadxaYuntian (Talk | contribs) |
|||
| Line 1: | Line 1: | ||
{{Zero_header}} | {{Zero_header}} | ||
| − | {{Languages|zero/dev/ | + | {{Languages|zero/dev/adb}} |
| − | [[Zero | Radxa Zero]] > [[zero/dev | Development]] | + | [[Zero | Radxa Zero]] > [[zero/dev | Development]] > [[zero/dev/adb | Using ADB ]] |
===Description=== | ===Description=== | ||
| − | Radxa Zero supports adb | + | 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 | + | One USB Type-C charging data cable can provide power while access the device in adb mode. |
| − | Here we use Type-C to Type-A USB cable with | + | 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 | * Kernel package version: >= 5.10.69-6-amlogic | ||
* amlogic-adbd package version: >=0.1 | * amlogic-adbd package version: >=0.1 | ||
| + | === Software Installation === | ||
| − | + | Please follow those guides to install adb on your [[Rock/windows_adb | Windows]] or [[Rock/linux_adb | Linux]] computer. | |
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | === | + | ===Common adb Usage=== |
| − | + | Below are some commonly used adb commands: | |
====Check adb devices==== | ====Check adb devices==== | ||
| Line 47: | Line 32: | ||
0123456789ABCDEF device | 0123456789ABCDEF device | ||
| − | ==== | + | ====Launch a root shell==== |
radxa@x86-64:~$ adb shell | radxa@x86-64:~$ adb shell | ||
# | # | ||
| − | + | To use bash shell, simply run <code>/bin/bash</code>: | |
radxa@x86-64:~$ adb shell | radxa@x86-64:~$ adb shell | ||
| Line 58: | Line 43: | ||
root@zero:/# | root@zero:/# | ||
| − | ==== | + | ====Send file from PC to Radxa Zero==== |
$ adb push <local path> <remote path> | $ adb push <local path> <remote path> | ||
Example: | Example: | ||
| − | |||
| − | |||
radxa@x86-64:~$ adb push /tmp/meet-radxa-zero.md /home/rock | 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) | /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! | How do you do! Radxa Zero! | ||
| − | ==== | + | ====Send files from Radxa Zero to PC==== |
$ adb pull <remote path> <local path> | $ adb pull <remote path> <local path> | ||
| Line 87: | Line 68: | ||
=== Usage of amlogic-adbd service === | === Usage of amlogic-adbd service === | ||
| − | Start 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 | $ sudo systemctl start amlogic-adbd | ||
| − | Stop amlogic-adbd service | + | Stop amlogic-adbd service: |
$ sudo systemctl stop amlogic-adbd | $ sudo systemctl stop amlogic-adbd | ||
| − | Reload amlogic-adbd service | + | Reload amlogic-adbd service: |
$ sudo systemctl reload amlogic-adbd | $ sudo systemctl reload amlogic-adbd | ||
| − | + | or | |
$ sudo systemctl restart amlogic-adbd | $ 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 | ||
Latest revision as of 02:46, 2 December 2021
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
