windows下使用adb工具调试Linux目标板

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.

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11

如果没有安装,可查找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

 
 
  • 1
  • 2
  • 3
  • 4

2.shell调试

在cmd窗口输入:adb shell
显示:

root@balong:/ #

 
 
  • 1

/
查看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

 
 
  • 1
  • 2
  • 3

3.上传文件到目标板

退出shell命令(在键盘上同时按住ctrl+c键),在cmd窗口输入:adb remount将设备改为可读可写。

显示:

remount succeeded

 
 
  • 1

将windows下C盘根目录下的log.txt拷贝到目标板的app/bin目录下,
输入adb push C:\log.txt app/bin
显示:

65 KB/s (339 bytes in 0.005s)

 
 
  • 1

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

 
 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11

火柴棍科技工作室:www.huochaigun.top

技术交流群

STM32MP1:861926625

ESP8266:476685983

无线(NB-IOT, Cat.1, 4G)通信模组:666129332

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值