Android Studio has extra unkown device - android

I am trying to do some remote debugging in Android Studio.
Recently I've had an issue where an extra device will pop-up named Unknown Device so when i run adb tcpip 5555 I get the error message: error: more than one device/emulator
So I need to get rid of this Unknown Device
So far here is what I've tried:
adb kill-server
Invalidate Android Studio Cache and restart
Restart my computer
Looked for anything in ~/.android/avd/ which may cause it (There was nothing)
Ran Android Studios troubleshooter which restarted adb
None of the above worked, does anyone have any idea what this Unknown Device may be, and how I can get rid of it?

Alright, so I did a check for updates in android studio, and there was a minor update available. After installing the minor update, the problem went away - It must've been some bug in whatever Android Studio version I had.

Related

Android studio is unable to initialize ADB

First I was having an issue of Error running app no default activity found, I somehow fixed that via reinstalling the android studio. my current android version is 3.3.2, now I can not connect any device via USB, it is just showing initializing ADB for like 1 second and then vanishes without recognizing the deployment device. It might be a primitive issue or maybe bug, I don't know, but one thing is for sure, it is an immense irritative process that is why I'm here finally, anyone? I'll appreciate your effort.
If the problem isn't in your USB cable.
Just open Android Studio terminal and type this
adb.exe start-server
Restart AS and it should work.
If that didn't work, maybe there is an ADB instance that is running, you should kill it with this command
Kill -9 adb

Error while trying to push/install .apk using adb

I've recently started encountering problems while trying to run my application from Android Studio on my MacOS machine. I tried to run the command from adb myself but I still can't get it to work, although the error appears different.
The errors I get are as follows;
Android Studio
10/02 09:54:53: Launching app $ adb push /Users/{username}/{path-to-apk}.apk /data/local/tmp/{package}
java.io.IOException: Broken pipe
Error while Installing APK
adb (via Terminal.app)
$ adb push /Users/{username}/{path-to-apk}.apk /data/local/tmp/{package}
adb: error: 65536-byte write failed:
Undefined error: 0
Now I've tried a lot of different things, some of which are just stretches because the problem appears to lie in something adb related, but none of this seems to change anything;
Different applications/apks
Different Android devices (total of 5)
Different USB-ports (all 4,
with and without USB-hub).
Different (or no) USB-dongles (USB-C to USB-A)
Restart/Invalidate Caches (Android Studio)
Reinstall Android Studio
Reinstall Android SDK
New (separate) install of Android SDK through homebrew
Reset NVRAM/PRAM
Reset SCM
Update to MacOS Mojave (and retry all of the above).
At this point I am at a loss. Has anyone encountered these errors before without having any of the above solutions fix it? Next thing on my list is a reinstall of the OS, but that feels like a bit of overkill.
I am running on MacOS Mojave on a 2016 Macbook Pro, but everything appeared to have the same effect on High Sierra.
Edit
Weird update on the behaviour, I can get the installing to work continuously after a restart by doing the following steps;
Login
Start Terminal.app
Manually repeat adb push command
(Command executes successfully)
Start Android Studio
Everything works fine...
However, if I start Android Studio without first manually doing the adb push in Terminal, everything is broken as described above.
Edit 2
Even calling adb start-server in Terminal before starting Android Studio makes everything work. So something appears to be faulty when Android Studio is responsible for starting the adb server..
I got the same error. I have no idea but start-server before starting Android-studio
Restart adb with the following command,
adb kill-server && adb start-server
Not really an answer but my issue appears to be solved with the latest release of Android Studio.

Unable to attach debugger to Android process in Android Studio 2.3.3

I have searched the internet and tried everything I have come across, but I cannot figure out what I am doing wrong. I cannot attach the debugger to my Android process in Android Studio.
I have built an app in Android Studio 2.3.3 on a virtual machine using VirtualBox and running Ubuntu 16.04.2. I have installed the app on my device, a Getac Data Logger, and have noticed that my app opens for a couple of seconds, displaying a blank white screen, and then crashes. So, I have attempted to debug the app on my device to find the problem. When I click on the "Attach debugger to Android process" icon, I can see my device as an option, however, when I select my device the OK button is grayed out. There is no way for me to move forward with this process. Sometimes the warning "debug info can be unavailable, please close other application using ADB: Monitor, DDMS, Eclipse" pops up, but not every time.
Does anyone have any ideas as to what I am missing? Does it have something to do with the limitations of working on a virtual machine?
Things I have tried:
Making sure I have allowed USB debugging on my device
Selecting all kinds of combinations of show all processes/auto/java/etc
Commands: adb kill-server, then adb start-server; adb kill-server, then adb -P 5038 start-server
Waiting to plug in my device until I launch the debugger attachment
Building debug variant
Adding android: debuggable="true" to my application in my AndroidManifest.xml, then noticing it was not necessary after building the debug variant and taking it back out
Disabling and re-enabling the ADB integration through Tools/Android/Enable ADB integration
Closing Android Studio and then opening it again
Changing the adb port
Invalidating cache/restart
Uninstalling the app, clean build, reinstalling the app
Installing the MTP using the command: apt-get install mtpfs. It says that mtpfs is already the newest version, but the Ubuntu error "Unable to open MTP device '[usb:001,021]'" does persist, just not always.
Revoking USB debugging authorizations, exiting out of Android Studio and my VirtualBox, rebooting everything, and setting it all up again.
PLEASE NOTE:
I am brand new to development (a little over a year experience in web development), brand new to app development (this is the very first app I am creating), brand new to Android Studio (again, very first app).
My device is showing up in the debugger as an option. It is just that the OK button is grayed out, no way to move forward.
I do NOT have Eclipse or Monitor (and therefore not DDMS either) running.
EDIT: I have noticed that "#com.android.ddmlib - Adb rejected connection to client '[numbers]': closed" is showing up in my terminal several times with several different number combinations. Not sure what this means. Perhaps I am running DDMS? I thought that was something that runs through Monitor?
Unplug your phone from your PC. Then plug it back in. On the pop-up, make sure you set it to “Media Sync (MTP)”.
I had intellij Idea IDE and Android Studio 4 Canary were open with Android projects at the same time, after closing both the IDEs and opening only android studio, I was able to attach the debugger to the app process.

How to resolve "Warning: debug info can be unavailable. Please close other application using ADB: Restart ADB integration and try again"

I am having a slight issue when trying to debug and android app via usb to external device. I keep getting the error "Warning: debug info can be unavailable. Please close other application using ADB: Monitor, DDMS, Eclipse
Restart ADB integration and try again
Waiting for process:"
I have tried stopping adb.exe in task manager , closing android studio and restarting , taking out the cable and putting it back and going to tools => android uncheck adb intergration then recheck it . All to no avail
This is a problem of ADB connections as sometimes ADB cache a dead connection on your real/virtual device and due to which the port is busy and u cannot connect to it.
The simplest solution to this is RESTART your ANDROID phone that's it.
What worked for me was to disable and re-enable USB debugging on the device.
Following steps resolved this issue to me:
Disconnect the device.
Restart android studio.
Run the project.
Simply go to your Android phone developer settings, disable USB debugging, delete all authorizations for USB debugging and turn the debugging on again.
First make sure you close any application use ADB , DDMS
like if you open Eclipse with android studio
Second restart your ADB from terminal
adb kill-server
adb start-server
The issue occurs when I open the Android Studio and IDEA together.
Restart the Android Studio does NOT fix the issue
Re-plugin the cable either does NOT fix the issue
Restart the Mac either does NOT fix the issue
Restart the ADB from terminal FIX the issue
adb kill-server
adb start-server
In this way, you do not need to close the IDEA.
Updated: 2022-09-19
Restart the Android Studio does NOT fix the issue
Invalidate and Restart the Android Studio does NOT fix the issue
Re-plugin the cable either does NOT fix the issue
Restart the Mac either does NOT fix the issue
Restart the ADB from terminal either does NOT fix the issue
Restart the Android device fix the issue.
This problem sometimes occur when Android Studio is opened with another IntelliJ Editor. Just close the other IntelliJ Editor.
Open USB preferences in your device. Like the image below.
Click another option. (eg:File Transfer)
Click the no data transfer.
If it doesn't work,please try again.
The operations on the android devices are similar.
this may happen when you created two instances of android studio, or else you are using same device in multiple ADB programs, so simply disconnect you device and then open your desired android studio instance and then connect again. now it will work fine.
i also use same method and every time it works.
IntelliJ IDEA (Ultimate, probably also Community) comes with Android plugin. If IntelliJ is started and any project is open and has been compiled (even without any Android code-base) then IntelliJ (apparently) steals the adb-connection from Android Studio. Either close IntelliJ or disable the Android plugin in IntelliJ.
If IntelliJ is open with android plugin, rebooting phone, killing adb etc. are only sporadic and short-time fixes of the problem as IntelliJ steals the adb connection again.
I resolved this issue by changing the Use USB for settings
Go to setting select transfer settings in my case MIDI was selected.
Go to Airplane mode ON and OFF , After that everything back to normal.
In my case, I had my device connected both via WiFi (with adb tcpip) and USB cable. Disconnecting the USB cable solved the issue.
Quite awkward issue, I think none of the solutions mentioned above worked for me.
Ultimately, I had to invalidate caches and restart.
File -> Invalidate caches... -> Select both options -> Invalidate and restart
For me was Eclipse using DDMS and conflicting with Android Studio, I wasn't using, so I just uninstall it.
If is your case, go to Eclipse > Help > About Eclipse IDE > Installation Details > Select DDMS and Uninstall..
At times ADB caches a dead connection on device(real / virtual) due to which the port is busy and it is unable to establish a connection.
You can try different ways:
You can kill and restart the server:
adb kill-server
adb start-server
2). Try disconnecting the device(phone) and reconnecting it.
3). Restart your device (phone).
Slightly different answer, but I'm including it for completeness.
For me Android Studio had frozen as well with the spinning beach ball of death.
I rebooted the emulator (by having it emulate a power-off/restart cycle)
Killed Android Studio (on a Mac by using ⌘⌥esc)
Restarted Android Studio.
After that everything was back to normal.
if you open two Android Studio at the same time (android studio preview),Will be like this
A possible temporary work around that may work prove useful for progress sake when intending to debug is to run the app in android studio , then immediately click on run => attach to debugger

Android adb.exe crashes - Only when called from Eclipse (win7 32)

ADB when run stand-alone works fine. I can connect to my device (HTC Desire) and perform .apk installs etc, so I know the USB drivers are working correctly. A common reason for this question, I know, but that can be ruled out.
Occasionally I can connect to the phone, very occasionally. 99% of the time I just get the standard windows popup "adb.exe has stopped working".
I've updated Eclipse to the latest version.
I'm sure the USB drivers are working correctly
I can connect via adb in command line mode with no issues.
I've searched for a solution until google begged me to stop :)
Seems like a DDMS Eclipse issue.
Any ideas ?
Actually, just before I sent this I had a brainwave.
Without Eclipse running I ran adb.exe from command line and performed an install -r of my .apk package.
All worked fine.
I then started Eclipse - the connection to my phone worked fine...
Nope, Eclipse now failing again. BUT with eclipse trying to connect (and failing) I can simultaneously run adb from command line and install the package. It's got to be Eclipse
If you have an alternate "launcher" or "home-screen" installed, that might be forcing the connection to close. If you have one installed, either force stop it or uninstall it.
I've found that some apps running in your phone can cause ADB to crash for some reason. Try to close unnessecary apps running on your phone when developing in eclipse
In my case, I had an instance of adb.exe from another package (Android-Sync) running. Processes with this file name are common in packages that sync devices. You can find more information about programs that use an adb.exe process here: What is adb.exe ? adb.exe info
To determine if you have an adb.exe process already running, look in your Task Manager on the Processes tab to find the running adb.exe. You can right-click and select Properties from the menu to find out the full path of the adb.exe.
To solve the problem and allow Eclipse access to the correct adb.exe, I shut down Eclipse and the emulator. Then I went into the Task Manager and shut down the running adb.exe. There may be more than one. Then I restarted Eclipse and the emulator. Fortunately, when I started my Android Virtual Device, that program was smart enough to start up the correct adb.exe.
In my case was kinda problem with USB driver. Just plug your phone always to the same USB port.

Categories

Resources