Android 设备选择器 -- 设备未显示
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2256884/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Android Device Chooser -- device not showing up
提问by mportiz08
I'm using Eclipse + ADT, and my physical device (listed below) is unlisted on Android Device Chooser. I have updated Eclipse and all of the Android packages. My phone is running Android OS 1.6, which corresponds to the target version listed in the Eclipse Project.
我正在使用 Eclipse + ADT,并且我的物理设备(如下所列)未在 Android 设备选择器中列出。我已经更新了 Eclipse 和所有的 Android 包。我的手机运行的是 Android OS 1.6,它对应于 Eclipse 项目中列出的目标版本。
Also, the reason I decided to try testing on a real device is because the emulator doesn't seem to be working right anymore when I run my project. The emulator launches, but the program never does. Any ideas?
此外,我决定尝试在真实设备上进行测试的原因是,当我运行我的项目时,模拟器似乎不再正常工作了。模拟器启动,但程序永远不会启动。有任何想法吗?
(using windows 7/t-mobile mytouch 3g)
(使用 windows 7/t-mobile mytouch 3g)
采纳答案by mportiz08
I think this was because the option for USB debugging wasn't checked on the device
我认为这是因为未在设备上检查 USB 调试选项
回答by giacatho
First, make sure that the Android ADB can "talk to" your device.
首先,确保 Android ADB 可以与您的设备“对话”。
- Open a Windows Command Prompt (cmd.exe)/Mac Terminal.
- Go to the folder (via
cd
) where ADB.exe is in, e.g, C:\Android\android-sdk\platform-tools. - Type
adb devices
- 打开 Windows 命令提示符 (cmd.exe)/Mac 终端。
- 转到
cd
ADB.exe 所在的文件夹(通过),例如 C:\Android\android-sdk\platform-tools。 - 类型
adb devices
If your device is listed (serial number is displayed), go to the second check. Otherwise, this means ADB currently can't talk to your device. There're many reasons which can cause the problem, try:
如果您的设备已列出(显示序列号),请转到第二个检查。否则,这意味着 ADB 当前无法与您的设备通话。导致问题的原因有很多,请尝试:
- In your device, turn on "USB Debugging Mode" in Settings -> Application -> Development.
- In your device, turn on "Allow installation of non-market Applications" in Settings -> Application -> Development.
- Restart your Windows/Mac.
- Restart the Android device.
- In Windows/Mac, reinstall device drivers.
- 在您的设备中,在设置 -> 应用程序 -> 开发中打开“USB 调试模式”。
- 在您的设备中,在设置 -> 应用程序 -> 开发中打开“允许安装非市场应用程序”。
- 重新启动您的 Windows/Mac。
- 重启安卓设备。
- 在 Windows/Mac 中,重新安装设备驱动程序。
Second, make sure you set the "Deployment target selection mode" to manual:
其次,确保将“部署目标选择模式”设置为手动:
- In Eclipse Package Explorer view, right click your Project, select Run As -> Run Configurations...
- In Run Configurations dialog, under Android Application. If your app doesn't exist, double click Android Application to create a new configuration, give it a suitable name (e.g. your app). Make sure this configuration is selected.
- On the right area, for Android tab, make sure your project displayed under Project; for Target tab, select "Always prompt to select device" or "manual".
- Click "Apply" and close the Run Configurations dialog.
The next time when you Run your app, you should see your list of devices.
- 在 Eclipse Package Explorer 视图中,右键单击您的项目,选择 Run As -> Run Configurations...
- 在运行配置对话框中,在 Android 应用程序下。如果您的应用程序不存在,请双击 Android 应用程序创建一个新配置,并为其指定一个合适的名称(例如您的应用程序)。确保选择了此配置。
- 在右侧区域,对于 Android 选项卡,确保您的项目显示在项目下;对于目标选项卡,选择“始终提示选择设备”或“手动”。
- 单击“应用”并关闭“运行配置”对话框。
下次运行应用程序时,您应该会看到设备列表。
Your device still can't display? Ok. Third, make sure your "Project Build Target" Android version is supported in your Device.
您的设备仍然无法显示?好的。第三,确保您的设备支持您的“项目构建目标”Android 版本。
- Check your device's Android version. In your device, select Settings->About Device.
- Check Android version of your project. Right click your project->Properties->Android->ProjectBuildTarget.
- Make sure that it's not newer than your device's version.
- 检查您设备的 Android 版本。在您的设备中,选择设置->关于设备。
- 检查项目的 Android 版本。右键单击您的项目->属性->Android->ProjectBuildTarget。
- 确保它不比您设备的版本新。
回答by Vishal
Also remember to set the 'Deployment target selection mode' to manual (Debug configurations -> target tab)
还要记住将“部署目标选择模式”设置为手动(调试配置 -> 目标选项卡)
回答by CatShoes
After following some of the steps in other answers here, as well as what is found here: ADB Driver for HTC Incredible, I had to issue two commands before my phone would show up.
在遵循此处其他答案中的一些步骤以及此处找到的内容:ADB Driver for HTC Incredible 之后,我必须在我的手机出现之前发出两个命令。
adb kill-server
adb start-server
Finally, after those two commands would my device show up when I ran
最后,在这两个命令之后,我的设备会在我运行时出现
adb devices
From time to time, the ADB process may get stuck(technical term there). When that happens, the above commands will not work. I have found that killing the ADB process (look in for adb.exe
in the Processes tab in Task Manager on Windows, or kill the PID for adb under linux), and then use
有时,ADB 流程可能会卡住(那里的技术术语)。发生这种情况时,上述命令将不起作用。我发现杀死ADB进程(adb.exe
在Windows上的任务管理器的“进程”选项卡中查找,或在linux下杀死adb的PID),然后使用
adb start-server
generally fixes that problem.
一般可以解决这个问题。
回答by Raj
This notefrom the Android Developer site is what worked for me:
来自 Android 开发者网站的这篇笔记对我有用:
Enable USB debugging on your device. On most devices running Android 3.2 or older, you can find the option under Settings > Applications > Development. On Android 4.0 and newer, it's in Settings > Developer options. Note: On Android 4.2 and newer, Developer options is hidden by default. To make it available, go to Settings > About phone and tap Build number seven times. Return to the previous screen to find Developer options.
在您的设备上启用 USB 调试。在大多数运行 Android 3.2 或更早版本的设备上,您可以在“设置”>“应用程序”>“开发”下找到该选项。在 Android 4.0 及更高版本上,它位于设置 > 开发人员选项中。注意:在 Android 4.2 及更高版本上,默认情况下隐藏开发人员选项。要使其可用,请转到“设置”>“关于手机”,然后点击“版本号”七次。返回上一个屏幕以找到开发人员选项。
回答by Daniel N
Using the Android SDK Manager may or may not actually install the Google USB Driver.
使用 Android SDK Manager 可能会也可能不会实际安装 Google USB 驱动程序。
Following the steps here: http://developer.android.com/sdk/oem-usb.html#InstallingDriverallowed Eclipse to display the device.
按照此处的步骤操作:http: //developer.android.com/sdk/oem-usb.html#InstallingDriver允许 Eclipse 显示设备。
回答by Iraklis
http://developer.android.com/tools/extras/oem-usb.html#InstallingDriver
http://developer.android.com/tools/extras/oem-usb.html#InstallingDriver
Windows 7
Windows 7的
To install the Android USB driver on Windows 7 for the first time:
首次在 Windows 7 上安装 Android USB 驱动程序:
Connect your Android-powered device to your computer's USB port. Right-click on Computer from your desktop or Windows Explorer, and select Manage. Select Devices in the left pane. Locate and expand Other device in the right pane. Right-click the device name (such as Nexus S) and select Update Driver Software. This will launch the Hardware Update Wizard. Select Browse my computer for driver software and click Next. Click Browse and locate the USB driver folder. (The Google USB Driver is located in \extras\google\usb_driver.) Click Next to install the driver.
将 Android 设备连接到计算机的 USB 端口。在桌面或 Windows 资源管理器中右键单击“计算机”,然后选择“管理”。在左侧窗格中选择设备。在右侧窗格中找到并展开其他设备。右键单击设备名称(例如 Nexus S)并选择更新驱动程序软件。这将启动硬件更新向导。选择浏览我的计算机以查找驱动程序软件,然后单击下一步。单击浏览并找到 USB 驱动程序文件夹。(Google USB 驱动程序位于 \extras\google\usb_driver 中。)单击下一步安装驱动程序。
回答by Arunabh Das
If you select Android Application in the Debug As dialog, you should be able to attach the debugger to the device directly. Make sure you run adb devices on your shell and see your device listed. If not, you will need to re-install the driver for the device. You can uninstall the drivers you have using USBdeview and then download and re-install the drivers until you see the serial number for the device listed when you run adb devices. - Arunabh Das
如果您在 Debug As 对话框中选择 Android Application,您应该能够将调试器直接连接到设备。确保在 shell 上运行 adb devices 并查看列出的设备。如果没有,您将需要重新安装设备的驱动程序。您可以使用 USBdeview 卸载您拥有的驱动程序,然后下载并重新安装驱动程序,直到您在运行 adb devices 时看到列出的设备序列号。- 阿鲁纳布·达斯
回答by Gavin Miller
None of the other answers worked for me. For me the device registered with eclipse after I rebooted the phone. Process for that is going to vary by phone model.
其他答案都不适合我。对我来说,在我重新启动手机后,设备在 eclipse 中注册了。该过程将因手机型号而异。
回答by jpCoder411
I had a similar problem...and my issue was related to using too high of an sdk....
我有一个类似的问题……我的问题与使用过高的 sdk 有关……
I changed:
我变了:
uses-sdk android:minSdkVersion="17" android:targetSdkVersion="17"/
to
到
uses-sdk android:minSdkVersion="8" android:targetSdkVersion="17"
and my problem was solved.
我的问题解决了。