最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

【已解决】ADT中的Android Virtual Device Manager中找不到我的android设备Samsung的PAD:GT-PT3110

Android crifan 10274浏览 0评论

【问题】

折腾:

【记录】ADT中通过USB连接调试Android设备

期间,ADT中的AVD Manager中,找不到已经插入的真实的android设备:

Samsung PAD GT-P3110

android virtual device manager can not find real connected android device

感觉很是奇怪。

【折腾过程】

1.参考:

Adb Devices can’t find my phone [closed]

去试试:

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\CLi>adb kill-server
'adb' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\CLi>

2.去adb目录下再去执行:

D:\DevRoot\android\adt-bundle-windows\sdk\platform-tools>dir
 Volume in drive D has no label.
 Volume Serial Number is CECE-859F

 Directory of D:\DevRoot\android\adt-bundle-windows\sdk\platform-tools

11/05/2013  03:26 PM    <DIR>          .
11/05/2013  03:26 PM    <DIR>          ..
11/10/2012  05:54 AM           851,968 aapt.exe
11/10/2012  05:54 AM           815,104 adb.exe
11/10/2012  05:54 AM            96,256 AdbWinApi.dll
11/10/2012  05:54 AM            60,928 AdbWinUsbApi.dll
11/10/2012  05:54 AM           275,968 aidl.exe
04/12/2013  10:32 AM    <DIR>          api
11/04/2013  05:12 PM         2,839,620 crifanLiTestAapt.apk
11/05/2013  11:20 AM         2,839,768 crifanLiTestAapt_withUsbHost.apk
11/10/2012  05:54 AM           127,488 dexdump.exe
11/10/2012  05:54 AM             2,618 dx.bat
11/10/2012  05:54 AM           157,184 fastboot.exe
04/12/2013  10:32 AM    <DIR>          lib
11/10/2012  05:54 AM        23,847,936 llvm-rs-cc.exe
11/05/2013  03:30 PM         2,840,613 MobileHandHeld.apk
11/10/2012  05:54 AM           467,531 NOTICE.txt
04/12/2013  10:32 AM    <DIR>          renderscript
11/10/2012  05:54 AM                33 source.properties
              14 File(s)     35,223,015 bytes
               5 Dir(s)  135,873,454,080 bytes free

D:\DevRoot\android\adt-bundle-windows\sdk\platform-tools>adb kill-server

D:\DevRoot\android\adt-bundle-windows\sdk\platform-tools>adb start-server
* daemon not running. starting it now on port 5037 *
* daemon started successfully *

D:\DevRoot\android\adt-bundle-windows\sdk\platform-tools>

然后再去重新拔插PT3110。

然后重新打开AVD管理器,还是找不到。

点了Refresh也找不到。

3.去:

C:\Users\CLi\.android

找不到对应的adb_usb.ini文件。。。

4.我这里的PT3110,是4.1.2,不是4.2,所以无需去“Settings > About phone and tap Build number seven times”。

5.参考别人,去重新安装对应的android设备,pt3110的驱动:

此处有2个驱动:

(1)先去卸载再重新安装对应的Portable Devices->GT-P3110

portable devices gt-p3110 uninstall

action scan for hardware changes for gt-p3110

GT-P3110 installed ready to use

(2)再去卸载和安装Samsung Android ADB Interface

SAMSUNG Android Phone->SAMSUNG Android ADB Interface->Uninstall

SAMSUNG Android Phone SAMSUNG Android ADB Interface Uninstall

need reboot for uninstall adb interface

所以去重启。。。

6.重启后,果然有点问题:

gt-p3110 device yellow exclaim mark hardware ids

然后去尝试去更新驱动:

try gt-p3110 update driver software

自动搜驱动:

search automatically for updated driver software for GT-P3110

结果说是已经装好了:

searching online for software for GT-P3110

the best driver software for your device is already installed for GT-P3110

7.那再去找找,之前对于Samsung的那个驱动。

SAMSUNG_USB_Driver_for_Mobile_Phones\SAMSUNG_USB_Driver_for_Mobile_Phones.exe

reinstall SAMSUNG_USB_Driver_for_Mobile_Phones exe

welcome to samsung usb driver for mobile phones v1.3.2000.0 mss install shield

welcome to samsung usb driver for mobile phones v1.3.2000.0 mss install wizard choose taiwanese

welcome to samsung usb driver for mobile phones v1.3.2000.0 mss install shield choose folder

welcome to samsung usb driver for mobile phones v1.3.2000.0 mss install shield installing

welcome to samsung usb driver for mobile phones v1.3.2000.0 mss install wizard complete

然后,可以看到win7自动会去安装驱动,最后是:

samsung mobile usb composite device usb modem adb interface ok but mtp device fail

即:

  • SAMSUNg Mobile USB Composite Device:Ready to use
    • 这个就是我们所希望看到的,正常的情况下,有这个USB Composite Device的。
  • SAMSUNg Mobile MTP Device:Failed
  • SAMSUNg Mobile USB Modem:Ready to use
  • SAMSUNg Android ADB Interface:Ready to use

8.重新拔插一下PT3110,看看是否全部可以识别。

然后是可以的:

found SAMSUNG Mobile MTP Device searching windows update

now ok for gt-p3110 can use now

可以打开对应的GT-P3110了:

gt-p3110 tablet found

9.这样,再去重新打开ADT,打开AVD Manager,

不过还是再去确认一把,设备管理器中,的确是可以看到对应的GT-P3110的各个设备的:

can see all samsung gt-p3110 devices in list

结果打开AVD Manager,还是看不到GT-P3110。

10.再次参考:

Adb Devices can’t find my phone [closed]

去试试:

D:\DevRoot\android\adt-bundle-windows\sdk\platform-tools>adb devices
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached
c080846d3761911 device


D:\DevRoot\android\adt-bundle-windows\sdk\platform-tools>

很明显,刚才是没开启adb,现在开启了。

然后可以找到设备了。

11.再去回到AVD Manager中,看看能否找到GT-P3110。

结果还是找不到。。点击Refresh也还是找不到。

12.参考:

Android: AVD manager won’t detect my HTC Hero phone as Virtual Device

去看看:

http://developer.android.com/sdk/win-usb.html

然后去:

adt android sdk manager

发现Extras中的Google USB Driver,没有安装:

extras google usb driver not installed

所以去安装:

select google usb driver install 1 package

google usb driver revision 7 accept install

downloading google usb driver revision 7

结果下载半天,都下载不下来:

Download interrupted Connection to https dl-ssl.google.com refused

所以,还是去手动下载:

Click here to download the latest Google USB Driver ZIP file

->

Download Google USB Driver

 click download google usb driver

accept license before download google usb driver

不过突然发现:

貌似不需要。毕竟此处已经安装好了Samsung的USB驱动了。

所以取消了。

13.再去确认,当前的adb中是可以找到设备的:

D:\DevRoot\android\adt-bundle-windows\sdk\platform-tools>adb devices
List of devices attached
c080846d3761911 device

然后再去看看adb的用法:

D:\DevRoot\android\adt-bundle-windows\sdk\platform-tools>adb devices
List of devices attached
c080846d3761911 device


D:\DevRoot\android\adt-bundle-windows\sdk\platform-tools>adb help
Android Debug Bridge version 1.0.31

 -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 <specific device>          - directs command to the device or emulator with the given
                                 serial number or qualifier. Overrides ANDROID_SERIAL
                                 environment variable.
 -p <product name or path>     - simple product name like 'sooner', or
                                 a relative/absolute path to a product
                                 out directory like 'out/target/product/sooner'.
                                 If -p is not specified, the ANDROID_PRODUCT_OUT
                                 environment variable is used, which must
                                 be an absolute path.
 devices [-l]                  - list all connected devices
                                 ('-l' will also list device qualifiers)
 connect <host>[:<port>]       - connect to a device via TCP/IP
                                 Port 5555 is used by default if no port number is specified.
 disconnect [<host>[:<port>]]  - disconnect from a TCP/IP device.
                                 Port 5555 is used by default if no port number is specified.
                                 Using this command with no additional arguments
                                 will disconnect from all connected TCP/IP devices.

device commands:
  adb push <local> <remote>    - copy file/dir to device
  adb pull <remote> [<local>]  - copy file/dir from device
  adb sync [ <directory> ]     - copy host->device only if changed
                                 (-l means list but don't copy)
                                 (see 'adb help all')
  adb shell                    - run remote shell interactively
  adb shell <command>          - run remote shell command
  adb emu <command>            - run emulator console command
  adb logcat [ <filter-spec> ] - View device log
  adb forward <local> <remote> - forward socket connections
                                 forward specs are one of:
                                   tcp:<port>
                                   localabstract:<unix domain socket name>
                                   localreserved:<unix domain socket name>
                                   localfilesystem:<unix domain socket name>
                                   dev:<character device name>
                                   jdwp:<process pid> (remote only)
  adb jdwp                     - list PIDs of processes hosting a JDWP transport
  adb install [-l] [-r] [-s] [--algo <algorithm name> --key <hex-encoded key> --iv <hex-encoded iv>] <file>
                               - push this package file to the device and install it
                                 ('-l' means forward-lock the app)
                                 ('-r' means reinstall the app, keeping its data)
                                 ('-s' means install on SD card instead of internal storage)
                                 ('--algo', '--key', and '--iv' mean the file is encrypted already)
  adb uninstall [-k] <package> - remove this app package from the device
                                 ('-k' means keep the data and cache directories)
  adb bugreport                - return all information from the device
                                 that should be included in a bug report.

  adb backup [-f <file>] [-apk|-noapk] [-shared|-noshared] [-all] [-system|-nosystem] [<packages...>]
                               - write an archive of the device's data to <file>.
                                 If no -f option is supplied then the data is written
                                 to "backup.ab" in the current directory.
                                 (-apk|-noapk enable/disable backup of the .apks themselves
                                    in the archive; the default is noapk.)
                                 (-shared|-noshared enable/disable backup of the device's
                                    shared storage / SD card contents; the default is noshared.)
                                 (-all means to back up all installed applications)
                                 (-system|-nosystem toggles whether -all automatically includes
                                    system applications; the default is to include system apps)
                                 (<packages...> is the list of applications to be backed up.  If
                                    the -all or -shared flags are passed, then the package
                                    list is optional.  Applications explicitly given on the
                                    command line will be included even if -nosystem would
                                    ordinarily cause them to be omitted.)

  adb restore <file>           - restore device contents from the <file> backup archive

  adb help                     - show this help message
  adb version                  - show version num

scripting:
  adb wait-for-device          - block until device is online
  adb start-server             - ensure that there is a server running
  adb kill-server              - kill the server if it is running
  adb get-state                - prints: offline | bootloader | device
  adb get-serialno             - prints: <serial-number>
  adb get-devpath              - prints: <device-path>
  adb status-window            - continuously print device status for a specified device
  adb remount                  - remounts the /system partition on the device read-write
  adb reboot [bootloader|recovery] - reboots the device, optionally into the bootloader or recovery program
  adb reboot-bootloader        - reboots the device into the bootloader
  adb root                     - restarts the adbd daemon with root permissions
  adb usb                      - restarts the adbd daemon listening on USB
  adb tcpip <port>             - restarts the adbd daemon listening on TCP on the specified port
networking:
  adb ppp <tty> [parameters]   - Run PPP over USB.
 Note: you should not automatically start a PPP connection.
 <tty> refers to the tty for PPP stream. Eg. dev:/dev/omap_csmi_tty1
 [parameters] - Eg. defaultroute debug dump local notty usepeerdns

adb sync notes: adb sync [ <directory> ]
  <localdir> can be interpreted in several ways:

  - If <directory> is not specified, both /system and /data partitions will be updated.

  - If it is "system" or "data", only the corresponding partition
    is updated.

environmental variables:
  ADB_TRACE                    - Print debug information. A comma separated list of the following values
                                 1 or all, adb, sockets, packets, rwx, usb, sync, sysdeps, transport, jdwp
  ANDROID_SERIAL               - The serial number to connect to. -s takes priority over this if given.
  ANDROID_LOG_TAGS             - When used with the logcat option, only these debug tags are printed.

然后去试试使用usb:

D:\DevRoot\android\adt-bundle-windows\sdk\platform-tools>adb usb
restarting in USB mode

再去AVD Manager中,还是看不到设备。

14.再去看看state:

D:\DevRoot\android\adt-bundle-windows\sdk\platform-tools>adb get-state device
device

D:\DevRoot\android\adt-bundle-windows\sdk\platform-tools>adb get-state
device

15.怀疑是 adb_usb.ini找不到:

【已解决】ADT对应的.android中找不到adb_usb.ini

16.然后:

重新拔插GT-P3110,重新启动ADT,重新运行adb devices:

D:\DevRoot\android\adt-bundle-windows\sdk\platform-tools>adb devices
List of devices attached
c080846d3761911 device


D:\DevRoot\android\adt-bundle-windows\sdk\platform-tools>adb start-server

D:\DevRoot\android\adt-bundle-windows\sdk\platform-tools>adb devices
List of devices attached
c080846d3761911 device

再去AVD Manager中看看,结果还是找不到设备。。。。

17.参考:

Adb Devices can’t find my phone [closed]

貌似是去DDMS中看设备的。

所以去看看。

的确是可以看到的:

on ddms can see online samsung gt-p3110 4.1.2 android device

那就继续去调试,看看能否有机会选择对应的在线的物理的android设备。

debug list choose this app

结果还是启动模拟器:

automatic target mode choose the selected avd emulator

18.尝试去debug configuration中,看看能否选择对应的物理设备去debug:

choose debug configurations for current app

然后从默认的,自动选择兼容的设备:

default auto choose compatible avd device

改为始终提示:

change to always prompt to pick device when debug

然后去debug:

然后的确可以去选择对应的,正在运行的,物理上已连接的,android设备了,samsung的GT-P3110了:

choose a running android device use same device for future launches ok

至此:

终于解决了:

在调试某个android项目的时候,可以在调试的时候,选择对应的,物理上已经连接的某个android设备了。

 

【总结】

核心提示就一句话:

在确保adb devices可以检测到设备后,把你的项目的debug configurations中把Automatically pick compatible device改为Always prompt to pick device以避免每次自动加载Android虚拟设备,

这样再去debug你的设备,就可以在弹出的Android Device Chooser中看到已连接的正在运行的物理的android设备了。

 

详细解释:

此处,ADT中,调试设备,在AVD Manager中,看不到对应的物理上已连接的android设备的原因是:

1.首先,希望“在Android Virtual Device Manager中看到已连接的物理设备”就是错误的想法:

即使物理上,已经连接了,此处的Samsung GT-P3110,实际上:

直接打开Android Virtual Device Manager,也是看不到的。

只能看到之前已创建的Android虚拟设备:Android Virtual Device

2.想要实现:

在调试某个android项目,可以选择,当前已连接的物理上的android设备的话:

需要满足以下条件:

(1)确保对应的android设备上,USB调试功能已打开

这个,多数人,都已经知道了。如图:

makesure enable usb debug mode

(2)确保你的Windows中的驱动,android设备的是正常的

对于此处的GT-P3110的话,驱动正常,意味着:设备管理器中,应该出现对应的那个

Samsung Mobile USB Composite Device

如图:

device manager show samsung mobile usb composite device

(3)确保你的ADT中,通过adb devices是可以检测到已连接的物理上的android设备的

此处,我这里就是:

D:\DevRoot\android\adt-bundle-windows\sdk\platform-tools>adb devices
List of devices attached
c080846d3761911 device

注:

1.如果看不到的话,可以去试试先干掉adb服务器,再启动adb服务器,然后再去检测设备

D:\DevRoot\android\adt-bundle-windows\sdk\platform-tools>adb kill-server

D:\DevRoot\android\adt-bundle-windows\sdk\platform-tools>adb start-server
* daemon not running. starting it now on port 5037 *
* daemon started successfully *

D:\DevRoot\android\adt-bundle-windows\sdk\platform-tools>adb devices
List of devices attached
c080846d3761911 device

2.对应的,也可以在DDMS中看到当前已经连接的该设备:

ddms also can show connectted online android device

(4)然后在调试的android项目之前,确保不要是自动选择了旧的Android虚拟设备,而是可以用Android Device Chooser选择对应的物理上已连接的设备的。

更改当前项目的调试设置:

(1)选择当前的项目

(2)点击调试下来菜单中的Debug Configurations

choose current project debug list choose debug configurations

然后再去配置:

我这里,就是很常见的错误配置:

之前默认一直设置的是:

Automatically pick compatible device: Always uses preferred AVD if set below, launches on compatible device/AVD otherwise

default is automatically pick compatible device use prefered avd

其会导致:

每次启动,会自动选择,你之前创建却选择的那个AVD(android virtual device,安卓虚拟设备),即emulator去调试你的项目了。

虽然物理上已连接真实的android设备,但是也不会出现让你选择的机会了。

所以,应该去改为:

Always prompt to pick device

change to always prompt to pick device then click debug

再点击Debug

这样去调试的话,就可以弹出对应的Android Device Chooser,让你有机会选择物理上已连接的android设备了:

android device chooser choose a running android device select samsung gt p3100 then ok

接下来,就可以去用真机去调试你的项目了。。

 

另:

之前的那个.android下面缺少adb_usb.ini,明显是没影响的。

转载请注明:在路上 » 【已解决】ADT中的Android Virtual Device Manager中找不到我的android设备Samsung的PAD:GT-PT3110

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
83 queries in 0.191 seconds, using 22.16MB memory