zoukankan      html  css  js  c++  java
  • Android---真机调试时不能识别手机的解决方案

    我自己遇到的问题是VS2013和VS2015中xamarin无法识别到真机,现象就是插上手机开启调试模式,豌豆荚都可以连接上手机,就是VS上没出现手机。
    但是低版本的手机貌似又行,4.0.3的。
    于是排除了各种问题,比如手机开发这模式,数据线,ADB驱动,ANDROID SDK升级,都不行,
    最后随意地点了下Restart Adb Server:
    发现居然可以识别到真机了,我只能说比较神奇。。。
     
    以下都是ADB连接问题,可以通过尝试如下步骤,由简单度排序
    1. 插拔下USB连接线
    2. 关闭USB模式再打开
    3. 执行以下命令
    1. adb kill-server  
    2. adb start-server    
     
    4.  效果与3相同
    DDMS - Devices - Reset adb
     
    5. 关闭所有PC套件,例如:
    杀死 Wandoujia  相关的所有进程,ok
    wandoujia_daemon.exe
    wandoujia_helper.exe
     
    6. 重启Eclipse
    7. 查看有几个ADB进程,全部杀死再重新启动ADB
    8. 查看下USB先是否连接电脑与手机
    9. 重启手机
    10. 关闭占用5037端口软件
    11. 更新adb (见问题14)
     
    1. 查看占用端口5037的PID值
    netstat -a -n -o |findstr "5037"
    输出结果:
      TCP    127.0.0.1:5037         0.0.0.0:0              LISTENING       5096
      TCP    127.0.0.1:5037         127.0.0.1:51577        ESTABLISHED     5096
      TCP    127.0.0.1:51577        127.0.0.1:5037         ESTABLISHED     4324


    2. 从上面得知PID = 5096占用了5037端口,现在通过PID查看进程名,看到底哪个进程占用此端口
    tasklist /v | findstr 5096
    输出结果:
    tadb.exe  5096 Console  1  4,932 K Unknown  ......  0:00:02 暂缺

    网上查询得知tadb.exe是腾讯管家启动的进程
     
    3. 杀死占用5037端口的进程 tadb.exe
    taskkill /f -pid 5096
    taskkill /im tadb.exe
    输出结果
    成功: 已终止 PID 为 5096 的进程。

    问题1 
     
    1. The connection to adb is down, and a severe error has occured.  
    2. You must restart adb and Eclipse.  
    3. Please ensure that adb is correctly located at 'adb.exe' and can be executed.   
    问题2
    1. ADB server didn't ACK  
    2. * failed to start daemon *   
    问题3
    1. Adb failed to restart! Make sure the plugin is properly configured   
    问题4
    1. ** Adb connection Error:远程主机强迫关闭了一个现有的连接   
    问题5
    1. java.io.IOException: 您的主机中的软件中止了一个已建立的连接。  
    2.       at sun.nio.ch.SocketDispatcher.write0(Native Method)  
    3.       at sun.nio.ch.SocketDispatcher.write(Unknown Source)  
    4.       at sun.nio.ch.IOUtil.writeFromNativeBuffer(Unknown Source)  
    5.       at sun.nio.ch.IOUtil.write(Unknown Source)  
    6.       at sun.nio.ch.SocketChannelImpl.write(Unknown Source)  
    7.       at com.android.ddmlib.JdwpPacket.writeAndConsume(JdwpPacket.java:213)  
    8.       at com.android.ddmlib.Client.sendAndConsume(Client.java:575)  
    9.       at com.android.ddmlib.HandleHeap.sendREAQ(HandleHeap.java:348)  
    10.       at com.android.ddmlib.Client.requestAllocationStatus(Client.java:421)  
    11.       at com.android.ddmlib.DeviceMonitor.createClient(DeviceMonitor.java:854)  
    12.       at com.android.ddmlib.DeviceMonitor.openClient(DeviceMonitor.java:822)  
    13.       at com.android.ddmlib.DeviceMonitor.processIncomingJdwpData(DeviceMonitor.java:781)  
    14.       at com.android.ddmlib.DeviceMonitor.deviceClientMonitorLoop(DeviceMonitor.java:649)  
    15.       at com.android.ddmlib.DeviceMonitor.access$100(DeviceMonitor.java:42)  
    16.       at com.android.ddmlib.DeviceMonitor$3.run(DeviceMonitor.java:577)  
    通常是同时打开了两个eclipse,关闭一个即可
     
    问题6
    1. Failed to install .apk on device '': Unable to open sync connection!  
    2. java.io.IOException: Unable to open sync connection!  
    3. Launch canceled!   
    问题7
    1. ADB rejected shell command (rm /data/local/.apk): closed  
    2. Error during Sync: Unable to open sync connection!  
    3. Error during Sync: Unable to open sync connection!  
    4. Adb connection Error:远程主机强迫关闭了一个现有的连接。  
    5. Connection attempts: 1  
    6. Connection attempts: 2  
    7. Connection attempts: 3   
    问题8
     
    1. Failed to install .apk on device  : Too many open files  
    2. com.android.ddmlib.SyncException: Too many open files  
    3. Launch failed on device:    
    问题9
    1. Failed to install .apk on device '': closed  
    2. com.android.ddmlib.InstallException: closed  
    3. Launch failed on device:  
    问题10
     
    1. Installation error: INSTALL_FAILED_INSUFFICIENT_STORAGE  
    2. Please check logcat output for more details.  
    3. Launch failed on device:  
       
    问题11
     
    1. Installation error: INSTALL_FAILED_UPDATE_INCOMPATIBLE  
    2. Please check logcat output for more details.  
    3. Launch failed on device:   
    使用PC套件删除,然后安装不行,通过adb uninstall 再次删除,安装ok
     
    问题12
    1. Android Launch!  
    2. Connection with adb was interrupted.  
    3. 0 attempts have been made to reconnect.  
    4. You may want to manually restart adb from the Devices view.  
    问题13
    1. Unexpected error while launching logcat. Try reselecting the device.] closed  
    2. om.android.ddmlib.AdbCommandRejectedException: closed  
    3.      at com.android.ddmlib.AdbHelper.executeRemoteCommand(AdbHelper.java:381)  
    4.      at com.android.ddmlib.Device.executeShellCommand(Device.java:462)  
    5.      at com.android.ddmuilib.logcat.LogCatReceiver$1.run(LogCatReceiver.java:109)  
    6.      at java.lang.Thread.run(Unknown Source)  
    问题14
    1. adb server is out of date.  killing...  
    2. * daemon started successfully *  
    3. error: device offline  
       
    出现问题的版本
     
    1. D:>adb version  
    2. Android Debug Bridge version 1.0.29   
       
    问题出在adb的版本太低,更新ADT后问题解决
     
    1. D:>adb version  
    2. Android Debug Bridge version 1.0.31  
  • 相关阅读:
    Ubuntu+XAMPP+Wordpress的安装与配置问题
    Html5最简单的游戏Demo——Canvas绘图的骰子
    Html5最简单的游戏Demo——Canvas绘图的弹弹球
    LinqToExcel: LINQ查询Excel电子表格
    Asp.Net Web API开发微信后台
    Json.Net使用JSON Schema验证JSON格式【实例】
    Json.Net使用JSON Schema验证JSON格式
    LeetCode-C#实现-哈希表(#349)
    大话设计模式-解释器模式
    大话设计模式-享元模式
  • 原文地址:https://www.cnblogs.com/zjoch/p/6124656.html
Copyright © 2011-2022 走看看