可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
Here is the problem. I want to run my Android Studio apps on my device (Samsung Galaxy Ace 2). But nothing works for me. Tell me what I've missed:
1) USB debugging is on
2) ADB driver is installed (in device manager i can see Android Composite ADB Interface)
3) ADB device list is still clear, even if i reset server(adb kill-server, adb start-server, adb devices - list of devices is clear)
4) in google usb driver directory, in android_winusb.inf file I added my device identificators
5) Android device manager still cannot connect to my device, showing this error when I reset it: "adb connection error an existing connection was forcibly closed by the remote host"
So I will be glad to hear any advices. Hope you'll help me
回答1:
Did you try to configure the "Media Mode" in "Camera (PTP)" instead of "Media device (MTP)"? This is sometimes solving the issue. Its in the USB Computer Connection options of your Android device, you should see an "authorize" dialog then.
Update 04/2017: looks like it has been fixed in Android 7.1.2
回答2:
Try swapping the USB port the cable is plugged into.
Sounds crazy but after 20 minutes of debugging this worked for me.
回答3:
I have done numerous ways of handling that issue. Finally it has worked! I am using LG Optimus II
, but I believe the following steps are generic to other Android devices as well.
Step 1:
Make sure your device is enabled for development. If yes, go to Step 2, otherwise go to Settings > About phone
and tap Build number
seven times which is magic number :-).
Now Developer Options
is available in the Settings
.
Step 2:
Before you plug your device to PC, Go to Settings > Developer Options
and select USB Connection method
.
Step 3:
Plug the phone to the PC, you are given options for the USB Connection method
, and please select Internet connection
. Make sure you have connected to the Internet. By the way, I have changed MTP
to PTP
, it did not work for me. Therefore, I tried Internet connection mode
, then it worked.
Step 4:
Run the app in the Android Studio
, it will ask you to authorize the device for development, and select YES!.
Step 5:
Run the application via Android Studio
and choose the device, not emulator, and BINGO! Welcome to Android development board.
回答4:
I also tried above solutions but got no luck. So here's what I did:
- Download and install PdaNet+ to fix connection issues between my computer and android device
- Enable USB debugging on my android device
- Run my app and voila! My android device is now recognized by Android Studio
回答5:
Although my computer could recognise my phone, I had to install the official drivers from the Samsung developer site to get adb/Android Studio to recognise it:
Samsung Android USB Driver for Windows
回答6:
Click Revoke USB debugging authorization in Developer option and try it again.
回答7:
Solution for those working with Huawei phones - You will get this error when ADB interface is not installed. Check if you have installed Huawei HiSuite. USB driver gets installed when you install HiSuite (I suppose this is true for most of the new phones that come with a Sync Software). If the ADB interface is installed on your computer you should see 'Android Composite ADB Interface' under Android Phone in your Device Manager as shown in this picture.
回答8:
LG Optimus Zone 2 pp415 d\n connect in mtp, but does work in internet connection mode. Lost lots of time messing with it. There's no doc for this, but I'd suggest trying all 4 of the connection options. Only 1 that works for me is Internet Connection->Ethernet, then win 8 auto-detects a driver and installs it. In MTP mode despite all drivers being registered with device manager, adb doesn't pick it up.
回答9:
I had the same problem. So here is what i did
- reinstalled the device driver
- changed the USB computer connection from MTP to Mass storage(UMS)
And it worked.
回答10:
For me, I tried the above. Turns out my USB cable was bad. I changed the cable and then it worked.
回答11:
I am sorry that i bothered you all. The problem was my device is cloned in different places in device manager. It was gone when I tried to update driver for my phone in "Other devices" list, and before i have been updating it in wrong sections. Thank you all.
回答12:
In my case it was due to already running and hanged adb.exe on another user under my PC. I had two users on my PC, the second user had the adb.exe process hanged even when I tried to end the process. It worked with me after (End Process Tree) from the Task Manager.
Hope this will help someone with multiple users :)
Ahmad
回答13:
In addition to the above configurations, I had to set deployment target to "Open Select Deployment Target Dialog", run once (choosing my device from the options listed), and from then on Android Studio was able to see my device even after changing the deployment setting back to "USB Device". My SWAG is that since Android Studio uses its own internal cache to find your device, it has to be initialized first.
回答14:
Change the connection method Build-In CD ROM it works for me
回答15:
I was on Samsung S8 and had same problem too. After I installed Samsung Kies, issues was resolved for me, as I believe it had updated the correct driver required for my Samsung S8.
回答16:
On HTC mini one 2, besides enabling the Developer Options, the following worked for me:
- Go to More in Wireless & Networks
- Mobile Network Sharing
- In USB network setting
- Select Internet pass-through