Please enable javascript, or click here to visit my ecommerce web site powered by Shopify.
Jump to: navigation, search

Difference between revisions of "Zero/dev/adb"

< Zero‎ | dev
(Usage of amlogic-adbd service)
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
 
{{Zero_header}}
 
{{Zero_header}}
  
{{Languages|zero/dev/otg}}
+
{{Languages|zero/dev/adb}}
  
  [[Zero | Radxa Zero]] > [[zero/dev | Development]] >> [[zero/dev/adb | Using ADB ]]
+
  [[Zero | Radxa Zero]] > [[zero/dev | Development]] > [[zero/dev/adb | Using ADB ]]
  
 
===Description===
 
===Description===
  
Radxa Zero supports adb function.
+
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 meet both power supply and adb requirement.
+
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 one port connected to the Type-C socket of Radxa Zero.
+
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.
And the other port connected to the Type-A socket of the PC.
+
  
===Hardware support===
+
===Radxa Zero Software Requirement===
 
+
Support hardware platform:
+
* All Radxa Zero
+
 
+
===Software===
+
  
 
* 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 ===
  
You'd better follow the installation steps.
+
Please follow those guides to install adb on your [[Rock/windows_adb | Windows]] or [[Rock/linux_adb | Linux]] computer.
 
+
=== Installation ===
+
 
+
==== Windows ====
+
 
+
Refer [[Rock/windows_adb | Windows ADB]]
+
 
+
==== Linux ====
+
 
+
Refer [[Rock/linux_adb | Linux ADB]]
+
  
===ADB Usage===
+
===Common adb Usage===
  
When you have adb driver installed on PC, below are some common used adb commands:  
+
Below are some commonly used adb commands:  
  
 
====Check adb devices====
 
====Check adb devices====
Line 47: Line 32:
 
  0123456789ABCDEF device
 
  0123456789ABCDEF device
  
====Login/Shell====
+
====Launch a root shell====
  
 
  radxa@x86-64:~$ adb shell
 
  radxa@x86-64:~$ adb shell
 
  #  
 
  #  
  
And type '/bin/bash' followed by Enter key to switch to bash 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:/#  
  
====Transmit files from PC to Radxa Zero====
+
====Send file from PC to Radxa Zero====
  
 
  $ adb push <local path> <remote path>
 
  $ adb push <local path> <remote path>
  
 
Example:
 
Example:
 
On PC, input the following in Terminal
 
  
 
  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
Check on Radxa Zero
+
# cat /home/rock/meet-radxa-zero.md  
 
+
  root@zero:/# cat /home/rock/meet-radxa-zero.md  
+
 
  How do you do! Radxa Zero!
 
  How do you do! Radxa Zero!
  
====Transmit files from Radxa Zero to PC====
+
====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
+
or
 
  $ sudo systemctl restart amlogic-adbd
 
  $ sudo systemctl restart amlogic-adbd
  
If you still have issue with adb, start a new post on the forum. https://forum.radxa.com/c/zero.
+
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 

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