问题
I am having trouble running an app I am developing in Android Studio on my Nexus 7. I have successfully gotten this to work before using the same tablet and computer (running Windows 8), but since having my laptop repaired and everything wiped I'm convinced something with my dev environment is messed up.
When I go to run the project, there are no available devices, so it is not recognizing my Nexus 7 anymore.
Things I have tried
- making sure my computer recognizes the device and that I have the Nexus 7 driver installed from ASUS
- going to the SDK manager and ensuring I have the Google USB driver installed
- closing Android Studio and re opening it, restarting my computer, restarting my Nexus 7
- killing adb.exe from the task manager
- ensuring I have USB debugging enabled and toggling that on and off
- switching from MTP to PTP and back again (currently connected as MTP, not sure if that is correct)
Any help would be greatly appreciated. This is very frustrating and I would like to just get back to developing again.
Update- I just noticed that when I go to developer options, "Wait for debugger" (near where you toggle USB Debugging) is grayed out. I think this has something to do with it but I'm not sure how to enable it.
回答1:
I got it!
This was at least the issue in my case, I hope maybe this will help someone someday, apparently I had not installed the adb driver properly:
Search for Device Manager from the search bar on the start screen Open Device manager, click on your Android device Select"Update Driver Software"
BOOM. Now Android Studio recognizes the device. I know this may not be the solution for everyone, but its worth a shot if you are having trouble testing apps on your device.
回答2:
Between upgrading my second-gen Nexus 7 to Android 5.0.x and Android Studio leaving beta I lost the ability to debug on my tablet.
To get this working again I used a combination of the above advice.
I grabbed a copy of the USB Driver from Asus, but updating the Device in Device Manager and pointing to the unzipped files wasn't enough.
The next step was to point Device Manager to the Android Studio sdk directory (on a 64-bit Windows 8 install that was C:\Program Files (x86)\Android\sdk
- beta versions of Android Studio - or %localappdata%\Android\sdk
- switched to in 1.x) and then things worked just fine again.
回答3:
Another possible reason that you may not be able to connect is: Don't forget to enable debugging mode in Android setting.
回答4:
I have had the same problem, although just getting started with my Nexus 5 and windows 7. I installed google usb driver package using SDK manager first, computer recognized phone but studio could not find it. Went in to manually update driver for phone but update driver couldnt find it, downloaded driver separately and pointed it to directory path, driver installed then studio found it and ran fine.
来源:https://stackoverflow.com/questions/26615319/android-studio-wont-recognize-nexus-7-as-device