K230 ADB User Guide#
ADB Function Description#
K230 supports the Android Debug Bridge (ADB) function, providing device debugging and file transfer capabilities. Through ADB, developers can interact with the K230 device on the PC side, including executing shell commands, transferring files, etc. The ADB function is particularly suitable for:
Remote debugging and log viewing
Application deployment and testing
File upload and download
ADB Configuration Description#
Board-side Function Configuration#
make rtsmart-menuconfig
# Find the corresponding configuration item
Components Configuration > Enable CherryUSB > Enable CherryUSB Device
-> USB Device Function
# Select to enable the function
Select CDC + ADB or ADB
Differences between several configurations:
CDC: CanMV IDE connection function
CDC+MTP: CanMV IDE connection function + CanMV disk function
CDC+ADB: CanMV IDE connection function + ADB function
ADB: ADB function
UVC: UVC Device function (not compatible with IDE and ADB functions)
Host Environment Configuration#
Windows Environment#
Download Android SDK Platform Tools:
Visit the Android Developer official website
Download the platform-tools archive for the corresponding platform
Extract and configure environment variables:
# Add the platform-tools directory to the system PATH environment variable
C:\path\to\platform-tools
Verify the installation:
adb version
Linux Environment#
# Ubuntu/Debian system
sudo apt update
sudo apt install android-tools-adb
# Or download platform-tools
wget https://dl.google.com/android/repository/platform-tools-latest-linux.zip
unzip platform-tools-latest-linux.zip
export PATH=$PATH:$(pwd)/platform-tools
ADB Command Description#
Device Connection Verification#
After connecting the device, execute the following command on the PC to verify the connection:
# View connected device list
adb devices
# Expected output:
# List of devices attached
# device
ADB Shell#
Enter interactive shell#
adb shell
Execute a single command in shell#
Basic syntax#
adb shell <command>
Usage examples#
# View memory usage
adb shell free
ADB File Transfer#
adb push - Upload file to device#
Basic Syntax#
adb push <local_file_path> <remote_file_path>
Usage Examples#
# Upload a single file
adb push C:\Users\user\test.txt /tmp/test.txt
# Upload a file and rename it
adb push ./local_config.json /tmp/config.json
# Upload to a specific directory
adb push ./app.bin /tmp
adb pull - Download file to PC#
Basic Syntax#
adb pull <remote_file_path> [local_file_path]
Usage Examples#
# Download a single file
adb pull /tmp/syslog ./logs/
# Download and rename
adb pull /tmp/debug.log ./debug_backup.log
# Download to current directory
adb pull /home/user/config.json ./
Notes#
The file transfer function only supports a single file and does not support transferring directories.
If you suddenly find that adb is disconnected during use, it may be that the USB cable has been moved. You need to shake and firmly plug in the USB cable.
