eclipse 为什么我的 android 设备在我的 Mac 上不可见?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/21801286/
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
how come my android devices are not visible on my Mac?
提问by mdarwin
I'm new to android development so apologies if this is a stupid question.
我是 android 开发的新手,如果这是一个愚蠢的问题,我深表歉意。
I'm having trouble seeing my android devices in Eclipse. I've switched on USB debugging, configured them to connect as a camera not mass storage, but when I run ./adb devices, there's no device showing, even though I have a Samsung Galaxy and a LG Nexus connected via USB. On both phones I get a notification saying "USB debugging connected" and "connected as a camera" so the phone obviously thinks it's connected.
我在 Eclipse 中无法看到我的 android 设备。我打开了 USB 调试,将它们配置为作为相机而不是大容量存储连接,但是当我运行 ./adb 设备时,没有设备显示,即使我通过 USB 连接了三星 Galaxy 和 LG Nexus。在两部手机上,我都会收到一条通知,上面写着“USB 调试已连接”和“已作为相机连接”,因此手机显然认为它已连接。
The problem appears to be intermittent. Sometimes the Galaxy shows up:
该问题似乎是间歇性的。有时银河会出现:
Macbook:~/workspace/android-sdks/platform-tools ./adb devices
List of devices attached
3334AB246B5200EC device
Then I unplug and reconnect it, and it disappears.
然后我拔下并重新连接它,它就消失了。
I've tried 3 cables and 2 devices now. Should I just give up and use an emulator instead?
我现在已经尝试了 3 条电缆和 2 台设备。我应该放弃并使用模拟器吗?
回答by Ben Wheeler
I had to download the Android File Transfer mac application, and then it worked fine. I also had to use the right USB cord -- some don't have a data channel.
我必须下载 Android File Transfer mac 应用程序,然后它运行良好。我还必须使用正确的 USB 线——有些没有数据通道。
回答by sgadde
Sometimes adb fails to recognize devices properly. Try "adb kill-server" and then "adb devices"
有时 adb 无法正确识别设备。尝试“adb kill-server”然后“adb devices”
回答by VonSchnauzer
I know your problem is intermittent and as Jim says, restarting Eclipse helps when unplugging the usb and plugging it in again doesn't help. I did however find this extremely helpful detecting a new device: adb not finding my device / phone (MacOS X). Give this a shot for your already discovered devices, to see if that helps.
我知道您的问题是间歇性的,正如吉姆所说,在拔下 USB 并再次插入时重新启动 Eclipse 会有所帮助。然而,我确实发现这对检测新设备非常有帮助:adb not found my device / phone (MacOS X)。为您已经发现的设备试一试,看看是否有帮助。