windows下使用ADB工具调试Linux目标板
平台准备
1.PC机安装ADB工具
检查windows系统是否安装了adb工具:
在windows下打开cmd窗口;
输入adb
如果安装了adb工具,会有如下提示:
Android Debug Bridge version 1.0.26
-d - directs command to the only connected USB device
returns an error if more than one USB device is present.
-e - directs command to the only running emulator.
returns an error if more than one emulator is running.
-s <serial number> - directs command to the USB device or emulator with
the given serial number. Overrides ANDROID_SERIAL
environment variable.
...
如果没有安装,可查找Windows安装ADB工具的方法,按照方法安装工具。
2.PC机连接目标板
PC机通过USB线连接到目标板。
adb调试
1.adb连接设备
在cmd窗口输入:adb devices
显示:
adb server is out of date. killing...
* daemon started successfully *
List of devices attached
0123456789ABCDEF device
2.shell调试
在cmd窗口输入:adb shell
显示:
root@balong:/ #
/
查看Linux版本信息:
root@balong:/ # cat /proc/version
cat /proc/version
Linux version 4.14.61 (wangyang@ubuntu-211) (gcc version 4.7 (GCC)) #1 PREEMPT Sun Jun 28 17:42:50 CST 2020
3.上传文件到目标板
退出shell命令(在键盘上同时按住ctrl+c键),在cmd窗口输入:adb remount
将设备改为可读可写。
显示:
remount succeeded
将windows下C盘根目录下的log.txt拷贝到目标板的app/bin目录下,
输入adb push C:\log.txt app/bin
。
显示:
65 KB/s (339 bytes in 0.005s)
shell登录目标板查看文件:
C:\Users\V505L>adb shell
root@balong:/ # cd /app/bin
cd /app/bin
root@balong:/app/bin # ls
ls
log.txt
# cd /app/bin
cd /app/bin
root@balong:/app/bin # ls
ls
log.txt
火柴棍科技工作室:www.huochaigun.top
技术交流群
STM32MP1:861926625
ESP8266:476685983
无线(NB-IOT, Cat.1, 4G)通信模组:666129332