连接步骤如下:
步骤 1
确保目标板和PC的互通,PING 彼此都可以:
work01@ubuntu:~/$ ping 192.168.1.111
PING 192.168.1.249 (192.168.1.249) 56(84) bytes of data.
From 192.168.1.247: icmp_seq=1 Redirect Network(New nexthop: 192.168.1.247)
64 bytes from 192.168.1.247: icmp_seq=1 ttl=64 time=10.5 ms
From 192.168.1.247: icmp_seq=2 Redirect Network(New nexthop: 192.168.1.247)
64 bytes from 192.168.1.247: icmp_seq=2 ttl=64 time=0.982 ms
步骤 2
adb kill-server
adb start-server
adb connect 单板IP:端口号(默认5555)work01@ubuntu:~/$ adb kill-server
work01@ubuntu:~//$ adb connect 192.168.1.111:5555
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
connected to 192.168.1.111:5555
adb remount
work01@ubuntu:~//$ adb remount
remount succeeded
步骤 3
测试是否连接成功,
查看连接到计算机的Android 设备或者模拟器:
adb devices
work01@ubuntu:~/$ adb devices
List of devices attached
192.168.1.111:5555 device
以上表示连接成功!
步骤4:
adb shell 进入目标板 建立自己的测试文件夹 test_folder
work01@ubuntu:~/$ adb shell
root@targetboard:/ # mkdir test_folder
步骤5:
adb push将你的测试文件传人目标班
work01@ubuntu:~/targetboard/$ adb push test_folder/ /test_folder/
push: test_folder/test_sample.o -> /test_folder/test_sample.o
1 files pushed. 0 files skipped.
149 KB/s (46046 bytes in 0.300s)
adb 从目标板拷贝到pc端:
首先确认连接是否正确:
work01@ubuntu:~/$ adb pull /mnt/pvr_rec/ .
pull: building file list...
pull: /mnt/pvr_rec/rec_v160_a80.ts -> ./rec_v160_a80.ts
遇到的典型问题:
1 adb error device offline
这个问题调试时候经常遇到,大多数时候执行:
adb kill-server
adb start-server
adb remount
有时候 上面的处理不够,
这时候需要在目标板上找到拉端口的adb进程,并杀掉
ps | grep adbd
root 1521 1 3560 4 ffffffff 00019160 S /sbin/adbd
root@Hi3716CV200:/ # kill 1521
但是,
无论如何重做多少次都没有效果,其实,这个时候就是硬件的驱动有些问题,端口被拉掉了,实践中解决的办法是这样的:
首先
01 断开目标板和hub的连接线,尤其是Hub的网络入口(大网)端连线
02 重新启动目标板
以上两步的理由就是通过硬件复位的方法,把锁住的端口释放
然后,重新做
adb kill-server
adb start-server
记住,做完之后,再重新连接硬件网线,这样可以保证端口确实被重新更新
在之后就是
adb connect 你的target板的ip
这时候再做
adb devices 就能看到原来的offline 消失了.
Android 解决adb server is out of date. killing... ADB server didn't ACK * failed to star
The connection to adb is down, and a severe error has occured.
[2010-03-11 09:36:56 - HelloOPone] You must restart adb and Eclipse.
[2010-03-11 09:36:56 - HelloOPone] Please ensure that adb is correctly located at 'D:\OPhoneSDK_1.5
\platform-tools\adb.exe' and can be executed.
解决:
方法1.cmd中adb kill-server,然后adb -startserver
方法2.方法1不管用,那么在任务管理器中杀死adb.exe,然后重启Eclipse。
方法3.方法1和2都不管用,那么查看最后一句报错中:platform-tools中是否有adb.exe(我的错误就是在相关路径下面没有platform-tools文件夹
,所以我选择新建一个文件夹,并且把tools中的文件全部复制到platform-tools中)
如果执行adb start-server 的时候报错:
adb server is out of date. killing...
ADB server didn't ACK *
failed to star
出现这个问题的根本原因是adb sever没有启动
执行adb kill-server
然后adb start-server 如果出现上面的错误一般是下面的原因造成的:
1、 开启了豌豆荚软件--->将豌豆荚kill掉就可以了
2、如果还是不行有可能是360或者其他软件将5037端口占据
1、执行命令查看是否端口被占用:
C:\Users\xxxxxx>netstat -ano | findstr "5037"
2、者执行tasklist查看进程:
复制代码
C:\Users\Administrator>tasklist
映像名称 PID 会话名 会话# 内存使用
========================= ======== ================ =========== ============
System Idle Process 0 Services 0 24 K
System 4 Services 0 44 K
smss.exe 256 Services 0 64 K
csrss.exe 428 Services 0 2,192 K
wininit.exe 488 Services 0 192 K
csrss.exe 496 Console 1 52,020 K
services.exe 536 Services 0 3,448 K
lsass.exe 552 Services 0 4,756 K
lsm.exe 560 Services 0 1,432 K
winlogon.exe 656 Console 1 1,528 K
svchost.exe 700 Services 0 4,176 K
复制代码
3、执行命令taskkill杀掉进程:
taskkill /pid xxx
4、再次查看 查看是否有软件占了5037端口,如有在任务管理器里面杀掉该进程.
5、重启eclipse
ref:
http://www.cnblogs.com/csulennon/p/3709064.html