Difference between revisions of "Rockpi4/dev/adb"
(Created page with "{{rockpi4_header}} {{Languages|rockpiS/dev/otg}} ROCK Pi 4 > Development > Using adb ===Description=== ADB is en...") |
|||
Line 43: | Line 43: | ||
root@rockpi4:/# | root@rockpi4:/# | ||
− | ====Transmit files from PC to ROCK Pi | + | ====Transmit files from PC to ROCK Pi 4==== |
$ adb push <local path> <remote path> | $ adb push <local path> <remote path> | ||
Line 51: | Line 51: | ||
On PC, input the following in Terminal | On PC, input the following in Terminal | ||
− | $ adb push /tmp/meet- | + | $ adb push /tmp/meet-rockpi4.md /home/rock |
0 KB/s (26 bytes in 0.045s) | 0 KB/s (26 bytes in 0.045s) | ||
Check on ROCK Pi 4 | Check on ROCK Pi 4 | ||
− | root@rockpi4:/home/rock# cat meet- | + | root@rockpi4:/home/rock# cat meet-rockpi4.md |
How do you do! ROCK Pi 4! | How do you do! ROCK Pi 4! | ||
Line 80: | Line 80: | ||
Firstly, update rockchip-overlay and kernel packages. | Firstly, update rockchip-overlay and kernel packages. | ||
− | $ sudo apt-get install -y rockchip-overlay # >= 2. | + | $ sudo apt-get install -y rockchip-overlay # >= 2.8 |
− | $ sudo apt-get install -y linux-4.4- | + | $ sudo apt-get install -y linux-4.4-rock-pi-4-latest # >= 4.4.154-115-rockchip |
− | Secondly, install rockchip- | + | Secondly, install rockchip-adbd package. |
− | $ sudo apt-get install -y rockchip- | + | $ sudo apt-get install -y rockchip-adbd # >= 0.3 |
Finally, start rockchip service | Finally, start rockchip service | ||
Line 91: | Line 91: | ||
$ sudo systemctl start rockchip-adb | $ sudo systemctl start rockchip-adb | ||
− | === Usage of | + | === Usage of rockchip-adbd service === |
− | Start rockchip- | + | Start rockchip-adbd service |
− | $ sudo systemctl start rockchip- | + | $ sudo systemctl start rockchip-adbd |
− | Stop rockchip- | + | Stop rockchip-adbd service |
− | $ sudo systemctl stop rockchip- | + | $ sudo systemctl stop rockchip-adbd |
− | Reload rockchip- | + | Reload rockchip-adbd service |
− | $ sudo systemctl reload rockchip- | + | $ sudo systemctl reload rockchip-adbd |
or | or | ||
− | $ sudo systemctl restart rockchip- | + | $ sudo systemctl restart rockchip-adbd |
If you still have issue with adb, start a new post on the forum. https://forum.radxa.com/c/dev | If you still have issue with adb, start a new post on the forum. https://forum.radxa.com/c/dev |
Revision as of 12:21, 18 November 2021
ROCK Pi 4 > Development > Using adb
Contents
Description
ADB is enabled in ROCK Pi 4 all Android version and official Linux distributions. To access ADB, you need a USB male A to A cable(Upper USB3 port) and turn the USB OTG switch to Device mode.
You'd better follow the installation steps.
Installation
Windows
Refer Windows ADB
Linux
Refer Linux ADB
ADB Usage
When you have adb driver installed on PC, below are some common used adb commands:
Check adb devices
$ adb devices List of devices attached 0123456789ABCDEF device
Login/Shell
$ adb shell #
And type /bin/bash followed by Enter key to switch to bash shell.
$ adb shell # /bin/bash root@rockpi4:/# root@rockpi4:/#
Transmit files from PC to ROCK Pi 4
$ adb push <local path> <remote path>
Example:
On PC, input the following in Terminal
$ adb push /tmp/meet-rockpi4.md /home/rock 0 KB/s (26 bytes in 0.045s)
Check on ROCK Pi 4
root@rockpi4:/home/rock# cat meet-rockpi4.md How do you do! ROCK Pi 4!
Transmit files from ROCK Pi 4 to PC
$ adb pull <remote path> <local path>
Example:
$ adb pull /home/rock/meet-pc.md /tmp/ 0 KB/s (19 bytes in 0.086s) $ cat /tmp/meet-pc.md How do you do! PC!
FAQs
Troubleshooting
If adb device is not detected on host PC, try to use serial console first and try the following:
Firstly, update rockchip-overlay and kernel packages.
$ sudo apt-get install -y rockchip-overlay # >= 2.8 $ sudo apt-get install -y linux-4.4-rock-pi-4-latest # >= 4.4.154-115-rockchip
Secondly, install rockchip-adbd package.
$ sudo apt-get install -y rockchip-adbd # >= 0.3
Finally, start rockchip service
$ sudo systemctl start rockchip-adb
Usage of rockchip-adbd service
Start rockchip-adbd service
$ sudo systemctl start rockchip-adbd
Stop rockchip-adbd service
$ sudo systemctl stop rockchip-adbd
Reload rockchip-adbd service
$ sudo systemctl reload rockchip-adbd or $ sudo systemctl restart rockchip-adbd
If you still have issue with adb, start a new post on the forum. https://forum.radxa.com/c/dev