You can debug Mixtile Blade 3 on Windows, Ubuntu, or Mac either using serial debugging or using Android Debug Bridge (ADB).
ADB is a command-line debugging tool that enables a variety of functions, such as tracking system logs, uploading files and downloading files. The default system of Mixtile Blade 3 is Debian 11 and you can also use ADB to connect the Blade 3 board.
The document describes how to debug Mixtile Blade 3 using ADB. For details about serial debugging, see Serial Debugging.
Preparations
- A PC (Windows, Linux or macOS)
- A USB-A to USB-C cable
- A power adapter with a USB-C connector at one end that supports USB PD 2.0
Debugging Steps
Step 1. Connect hardware
- Connect one end of the USB cable to Blade 3’s USB port that is away from the corner and the other end to the PC.
- Connect the power adapter to Blade 3’s USB port that is near the corner.
Step 2. Install ADB
You need to install ADB according to the operating system running on your PC.
On Windows
- Download ADB and unzip the file to a customized installation directory, such as
C:\adb\platform-tools
. - Press
Windows
+R
to open Run. Then entersysdm.cpl
and pressEnter
. - Choose Advanced > Environment Variables > System Variables > Path.
- Create a new directory
C:\adb\platform-tools
under Path.
On Ubuntu
To install ADB on Ubuntu, run the following command:
sudo apt-get update
sudo apt-get install android-tools-adb
On MacOS
- (Optional) Install the Homebrew tool if it is not installed yet by running the following command:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
2. Install ADB on macOS by running the following command:
brew cask install android-platform-tools
Step 3. Verify ADB connection status
On Windows
Run the following ADB commands to verify whether the ADB connection is successful.
C:\Users\user> adb devices
List of devices attached
I002TDRJNA device
C:\Users\user> adb shell
root@blade3:/#
root@blade3:/#
On Linux and macOS
Run the following ADB commands to verify whether the ADB connection is successful.
$ adb devices
List of devices attached
I002TDRJNA device
$ adb shell
root@blade3:/#
root@blade3:/#
Commands for Debugging
Via ADB, you can obtain the debugging information.
- Getting system logs via ADB logcat
adb logcat [Options] [Label]
For example:
# View all logs.
adb logcat
# Show only parts of the logs.
adb logcat -s WifiStateMachine StateMachine
- Getting system bug reports
For example:
adb bugreport
# Save to host, then open it with text editor to view ADB
adb bugreport >bugreport.txt
- Getting root permission
If TARGET_BUILD_VARIANT is in user debug mode, you need to run the following command to get root permission:
adb root
Switch the device side of ADB to root mode for commands that require root access, such as ADB remount.
Appendix: Other Common ADB Commands
This section introduces other ADB commands that are commonly used for your reference.
Commands for Managing Connections
To display related devices and their serial numbers, run the following command:
adb devices
If there are multiple connected devices, you need to use the serial number to tell them apart by running the following command:
export ANDROID_SERIAL=<SerialNumber>
adb shell ls
To connect to a specific device, run the following command:
adb -s SerialNumber shell
For more ADB commands, run adb –help:
adb --help