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
If your device is not correctly detected in RAD Studio or in the system Device Manager, check the following: Ensure that your Android device is unlocked and not sleeping while connected via USB. Set the appropriate option in Settings or Developer Options. Make sure your Android device is enabled for USB debugging.
In Android Studio, select your app from the run/debug configurations drop-down menu in the toolbar. In the toolbar, select the device that you want to run your app on from the target device drop-down menu.
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
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.
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
.
Before you plug your device to PC, Go to Settings > Developer Options
and select USB Connection method
.
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.
Run the app in the Android Studio
, it will ask you to authorize the device for development, and select YES!.
Run the application via Android Studio
and choose the device, not emulator, and BINGO! Welcome to Android development board.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With