Device connection lost after APK install from MacBook - android

I'm running into a problem on my MacBook Pro. I type in "adb devices" with my device plugged in and I can see it listed there. However, when I install the application with "adb install" the connection gets dropped. This happens both in the Android SDK and in Eclipse. When I launch it in Eclipse I get this exception:
[2012-05-11 08:12:34 - Unexpected error while launching logcat. Try reselecting the device.] device not found
com.android.ddmlib.AdbCommandRejectedException: device not found
at com.android.ddmlib.AdbHelper.setDevice(AdbHelper.java:752)
at com.android.ddmlib.AdbHelper.executeRemoteCommand(AdbHelper.java:373)
at com.android.ddmlib.Device.executeShellCommand(Device.java:397)
at com.android.ddmuilib.logcat.LogCatReceiver$1.run(LogCatReceiver.java:102)
at java.lang.Thread.run(Thread.java:680)
I unplug the device and reconnect it and it shows up right until the moment when I try to run the application.
This problem does not seem to happen on my Windows box.
(I do not have tethering on the Macbook and it is disabled on my Android device)

Related

Android Studio: Installation failed due to: 'device 'xxxxxxxx' not found'

I'm struggling with an issue connecting Android Studio to my Google Pixel 2.
When I plug my phone into my laptop, Android Studio now recognizes the physical device and shows 'Google Pixel 2' in the dropdown of devices to run the app on. When I go to run the app, it compiles without error but when it tries to install the app on my phone the connection between my phone and AS is lost (the device is no longer listed in the dropdown) and this error message is shown in the Run dialog:
06/12 17:08:35: Launching 'app' on Google Pixel 2.
Installation did not succeed.
The application could not be installed.
List of apks:
[0] '/home/kirk/Apps/xxxx/android/app/build/outputs/apk/debug/app-debug.apk'
Installation failed due to: 'device 'xxxxxxxx' not found'
Retry
Clicking the Retry link just results in it being launched in an emulator.
I've tried disconnecting and reconnecting the device, revoking the USB debugging authorisations then re-trusting my computer, as well as closing and re-opening Android Studio.
Any ideas?
Android Studio–>Preferences–>Build,Execution,Deployment–>Debugger–>“Use libusb backend”, select false–>Apply–>Ok
Sometimes ADB just need a restart.
adb kill-server
adb start-server
In my case I had a plugin to connect via wifi, like:
Android WIFI ADB
Try to uninstall this type of plugin then clean Android Studio on Invalidate Caches / Restart...
This happened to me when I was sharing Wi-Fi from my PC to the phone.
When I disconnected my phone from my PC's Wi-Fi, everything worked.
It could be an issue with ADB rather than Android Studio
I think it is problem with adb not with android studio I tried updating adb it worked for me. Try once

Android studio Error during Sync: An existing connection was forcibly closed by the remote host

I've been debugging for months with a physical Samsung pad connected via USB and now I can't load the app on the device for debugging. I rebooted everything yesterday and it worked until this afternoon! I get the same error all the time. The ADB appears to be running on port 5037.
I'm disappointed in how buggy the development environment is and feel like I'm spinning my wheels like back in the Win3 days fighting the environment instead of the app. Any suggestions would be appreciated...
3:11 PM Gradle build finished in 2s 40ms
3:11 PM Error during Sync: An existing connection was forcibly closed by the remote host
3:11 PM Session 'app': Error Installing APK
I'm using USB debugging. I've tried everything I can find on SO and nothing works:
1) Rebooted both laptop and device many times
2) Deleted app from device
3) Manually updated the SDK to 8.1.0 (auto update fails with file size error)
4) Unplugged and tried a different USB port
5) Updated the Samsung Android ADB interface from Win7 device manager
6) Killed adb via task manager and SDK kill-server and start-server
7) Turned USB / Developer mode off and on again
8) Deleted the device from Win Device Manager; re-scanned; updated driver software
I had this error.
There is low RAM in the system. I just closed some programs (Chrome used 1GB) and restart Android Studio.
Try also delete folder "build" and "app/build".
I can make this happen at will now and it seems like it happens when the device goes into sleep mode. So I'm debugging and all is working well and the problem occurs. I stop the app via Android Studio and reboot the Samsung pad. After that I get the funky temp device showing up and the ADB won't install. The fix is to unplug the USB cable. Wait about 1 minuet and plug back in. The temp device is gone and the pad shows up. All works well.

macbook adb cannot open interface

I am encountering a problem with Android ADB debugging through USB.
Using Macbook Air 2013 and trying to connect Nexus 6 dev phone.
On the MAC Android Studio, android latest sdk is installed.
When I do
adb kill-server
adb devices
I get:
adb I 661 9881 usb_osx.cpp:259] Found vid=18d1 pid=**** serial=*****
adb I 661 9881 usb_osx.cpp:259]
adb E 661 9881 usb_osx.cpp:331] Could not open interface: e00002c5
adb E 661 9881 usb_osx.cpp:265] Could not find device interface
So it found the device, vendor id, product id and serial match what I find in the system information for the Nexus 6.
Following suggestions found online I tried - but no success - the following to resolve:
dis- and reenabling debugging mode on the phone, also switching between USB configs for charging, MTP, PTP, RNDIS, Audio Source, MIDI, always making sure the authoriztation for the Mac's RSA fingerprint is given
closing Android Studio / DDMS, killing adb through 'kill-server' command as well as killing process through Apple activity monitor
run adb as root
reboot the Mac several times
reboot the Nexus 6
reinstall Android SDK completely
tried with another debugging enabled Android Device (Samsung Galaxy Tab, also here adb found correct device info but cannot access interface with same error)
tried with 3 different USB cables, all cables which were originally shipped with Android devices
Through google I learned that error code e00002c5 means the device is already in use by another driver.
I had recently installed Sophos Home Antivir. Thinking that this might prevent ADB from opening the device interface, I uninstalled Sophos completely with the provided uninstaller and rebooted the Mac.
Any hint is appreciated:
which steps to resolve?
as e00002c5 seems to be a clear indicator that another driver has the device in use, how to find out which process that is and how to stop it from doing that
I ran into this error as well, and it turned out that the problem for me was that a Stetho tab was open in Chrome (i.e. a tab at URL chrome://inspect/#devices ), which I guess was causing the device to be in use. Closing that tab, then running adb kill-server, made adb devices work again.
Same symptoms with a Galaxy S7 attached to Mac via USB. In my case, I had the Tizen IDE for Samsung Gear Development open. That also prevented adb working properly. Closing the Tizen IDE immediately helped.
In case you connect the mobile phone the first time, you may already have acknowledged the authorization for the computer on the phone. You have to delete the authorization on the phone and re-connect / re-auth it. Otherwise, the device will show in the device list, but is unauthorized. (I.e. you can't debug...)
If you are using VirtualBox and have a virtual machine opened, you are probably trying to use adb from your host while it is plugged on your virtual machine. The problem is that you cannot have your device plugged on both at the same time.
Solution : Uncheck your device on the bottom right panel if it is detected by your Virtual Machine.
If you have been accessing your device on virtual box and now trying to access it from your host OS, first you have to disconnect your device from the virtual box. To do that go to setting> USB > unchecked the device from list
Then unplug your phone first and replug it. Or kill and start the server using >adb kill-server
>adb start-server. It works for me.
I encountered this issue with the message "Could not open interface: e00002c5". e00002c5 indicates that another app is using the device. Tizen studio was the app causing this issue.
Closed Tizen IDE and connected devices were available in the adb devices list.
I was debugging my Mobillyo app with a LG K4 phone. I closed Android Studio then enabled USB Debugging in the phone settings,left the settings open, reopened Android Studio did RUN, a dialog opend with the phone info and Unauthorized, was asked to approve on the phone, touched Ok and it worked.

What are the reasons that ADB and Android studio stop recognising a device

A few times a day my device disappears from the adb devices list.
Running: adb devices from the command line just says List of devices attached with no devices and no device is visible in run dialog of Android Studio.
I'm using the latest version of the Android SDK with a Nexus 5 (Lollipop 5.0.1) on Windows 8.1 but I have the same problem with a Samsung Galaxy S2.
It will work for a few hours but then I will get a log entry "device disconnected" and the device disappears. The device is still visible in Windows explorer and the USB debugging connected notification is still shown on the device.
Running adb kill-server doesn't fix the problem.
Disconnecting and re-connecting the device usually fixes the problem but sometimes I need to restart the device.
Has anyone experienced this or have ideas of how to debug it?
One of the debug methods apart from adb kill server, reboot device or pc is to scan for hardware changes.
MyComputer properties -> Device Manager->
Right click on PC-Name scan for hardware changes. Of course the device must be connected while doing this
This saved me quite a few times.

Android development: No compatible AVD or devices?

I am getting the following error in my console in eclipse when I try to run my application on my Samsung S4 phone:
[2014-06-30 13:49:53 - Multapply] Android Launch!
[2014-06-30 13:49:53 - Multapply] adb is running normally.
[2014-06-30 13:49:53 - Multapply] Performing com.example.multapply.Splash activity launch
[2014-06-30 13:49:53 - Multapply] No active compatible AVD's or devices found. Relaunch this configuration after connecting a device or starting an AVD.
This is strange as I ran the application yesterday without any problems. I am also sure that debugging is enabled on my phone?
First verify whether your device is connected or not by giving following command:
'adb devices'
It should show your device name along with state as 'device'.
If your device is not displaying then try these commands,
'adb kill-server'
'adb start-server'

Categories

Resources