可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
When I type adb devices
command on terminal, it shows device is connected
List of devices attached
0123456789ABCDEF device
But when I type adb logcat
command, it hangs with below message
waiting for device
Can anybody tell me what is the problem behind this? I test the device on cts.
回答1:
I am not pretty much sure if this works for you but can you please try the steps below:
# Kill and restart $ adb kill-server $ adb start-server daemon not running. starting it now * daemon started successfully * # Device appears, but is listed as offline $ adb devices $ adb logcat
回答2:
I have also experienced similar problems I think I solved it by having the USB debugging option switched on within Developer Options in Settings.
REPEAT The following steps above, it should work!
回答3:
What OS are you using? It can be a variety of different reasons. Did you make sure you only have either the emulator running or a device attached? If so, you can direct your adb command by using the -d or the -e flag.
回答4:
I had this same problem on Ubuntu 12.04. Thankfully MickeyMicro had the solution that worked for me:
Run the command: gksudo gedit /etc/udev/rules.d/51-android.rules
Add the following line to the blank file
SUBSYSTEM=="usb", ATTR{idVendor}="2080", MODE="0666" (I used this one on 12.04)
SUBSYSTEM=="usb", SYSFS{idVendor}="2080", MODE="0666" (Another recommended for 10.04)
Save and close gedit.
Run the command: sudo chmod a+rx /etc/udev/rules.d/51-android.rules
Restart the system.
Run the command: sudo sh -c "mkdir -p ~/.android; echo 0x2080 > ~/.android/adb_usb.ini; adb kill-server; adb devices"
- Verify that you have permissions to access the device. adb devices should return normal response, rather than a "???????????? no permissions" message.
http://forum.cyanogenmod.com/topic/23163-need-help-for-adb-connection-on-ubuntu/
回答5:
I got Nexus tab today and I had to go to Settings -> About Tablet -> (tap 7 or 8 times) on Build Number.
Then 'Developer Options' showed up above 'About Tablet'.
Next in Developer Options, after enabling USB Debugging I was able to get the logs
For Mac Users:
cd /Applications/Android/sdk/platform-tools
./adb logcat
回答6:
When I have experienced this infinite "waiting for device" on Windows I had simply forgotten to enable usb-debugging in the developer options of my device.
回答7:
Here is yet another potential method to solve this -- in the past, the above solutions will work, but in my case, this time, this was the thing that fixed it:
- Plug device into USB
- Settings -> Developer Options
- Revoke USB Debugging Authorization
- Unplug Device
- Repeat Step 1
- Authorize Device
- Repeat Steps 4&5
adb devices
should now show device
adb logcat
should now output logs from device
回答8:
I had similar problem on Galaxy S3, with adb running on Ubuntu 11.10 OS. In my case, If I reconnect the device (pull the USB connection and reconnect it), the log cat starts working. This happens only for the first time I connect the device after powering it up. Once logcat starts working, then it continues to work smoothly, without needing to reconnect.
回答9:
This happend to me on OS X mountain lion. To fix it I had to
open Activity Monitor, filter all processes named "adb" and force quit them (I had 3 running). Then reconnect the device and everything was working again.
回答10:
On my Samsung Galaxy S4 I had the same problem but after 10-20 seconds a dialog pops up on the phone where I have to accept the debug request
回答11:
I had a similar problem, but for different reasons. My issue came from programing usb accessory on android, which changes the vid/pid when in accessory mode. The solution for me that worked was the following:
- Connect the phone
- Run the usb host side accessory mode commands (Example website: http://android.serverbox.ch/?p=262 )
- Phone should have reconnected in accessory mode (Ensure the PID has adb: 0x2D01)
- adb kill-server
- sudo adb start-server (This caused the phone to re-ask auth permission)
- adb logcat (In my case I wanted to watch the logs, this now worked in accessory mode)
回答12:
In my case, I was using an old version of adb
, make sure you have the latest version of adb
. You can download here, extract and run straight within the folder ./adb
.