Error "AdbCommandRejectedException: device not found" in Eclipse using Android emulator - android

I've tried to change the build of an application, and now eclipse doesn't work.
There is nothing in the console, and when I launch the debug, there is nothing on the log.
I just got this message :
[2011-03-31 11:22:58 - Logcat]device not found
com.android.ddmlib.AdbCommandRejectedException: device not found
at com.android.ddmlib.AdbHelper.setDevice(AdbHelper.java:736)
at com.android.ddmlib.AdbHelper.executeRemoteCommand(AdbHelper.java:373)
at com.android.ddmlib.Device.executeShellCommand(Device.java:284)
at com.android.ddmuilib.logcat.LogPanel$3.run(LogPanel.java:527)

Try adb kill-server and adb start-server to restart the adb. It can be found in your android sdk directory, subfolder plattform-tools.

Restart the eclipse once...and try again
...

on-off your USB debugging on mobile phone or your AVD maybe help you solve this problem. This method is work for me :)

I encountered a similar issue on Linux. It turned out that my adb server was running under my user account, so running the following fixed the issue:
sudo adb kill-server
sudo adb start-server

I also faced same problem.
Go to developers Option and then Revoke USB debugging authorization.

Restart the eclipse and check if the error continues.
Also check if you have correct version of AVD manager installed or not.

If you are using the Emulator and restarting adb doesn't solve the problem then close the current running Android virtual device and Launch it again.

For some reason my device had gone offline, reconnecting the device resolved the issue.

Related

Android Studio - Unable to open debugger port: java.io.IOException

I am stuck in a problem here.
I cannot attach debug using Android Studio 3.5.1.
Its keeping showing me the message "Error running 'Android Debugger (8600)': Unable to open debugger port (localhost:8600): java.io.IOException"
I tried a lot of things like:
adb reset
invalidate
restart windows
reinstall android studio
and none of them works.
And I cannot find Enable ADB Integration on this version.
Anyone knows how to fix it?
EDIT
Debugging with emulator is working with all versions.
Debugging with devices is working only with devices with Android 9.0+
Kill and start adb didn't work.
I dont think its a local problem because its happen with a lot of people here. Its seems to be a project problem
You might check this 3 things:
1.
Youre not running a not debuggable version.
android:debuggable="false" in Android Manifest
2.
In Android studio you re not building a release version
Check in Build variants in bottom left corner.
3.
If nothing works use Troubleshoot device connections
Tools -> Connection Assistant
or older version
Tools -> Troubleshoot device connections
And try out the helper page from google (seems for older versions)
https://developer.android.com/studio/run/device#assistant
Try this:
adb kill-server
adb start-server
adb usb
For linux, e.g., ubuntu: start all commands with sudo like this:
sudo adb kill-server.
its your connection issue, cant find your device DNS.
what is your OS ?
In windows:
you must go to network and find duplicate dns and clear it (Search for
it)
In mac:
you must kill adb or delete that and run a new version
last hit is Update emulator in sdk
.First you need to check your build.gradle(app) file , and ensure that your build is debuggable.
.If debuggable then you need to check adb is working or not in your system, you can
check by just press 'adb' .
if its working then check devices by 'adb devices', it will show all connected devices.
add kill-server then enter and adb start-server
Try this. I have had luck with this approach when I run into problems with adb.
You can check if the device is recognised or not using
adb devices
If it is indeed recognised you may try to kill adb and start it again
add kill-server
adb start-server

Genymotion Still waiting at "Booting"

I use Genymotion for Android Studio but genymotion still booting does not On status
I searched for a solution and followed
Uninstall and Re-install
Clear Cache
Remove device and new install
Fix Host-Only Ethernet to default
And another thing to try
But I can't fix it
Genymotion v3.0.1
VM VirtualBox v6.0.4
Please help me find a solution. Help me.
Sorry for my english
Tried to reset cache, re-create the device, toggle network mode, upgrade Genymotion to 3.0.1, and NONE of them worked.
A temp fix to change "booting" status to "on":
Open Genymotion Shell
run devices list
then run in a new terminal adb connect [DEVICE IP]:5555
Looks, like this is some adb or Genymotion bug. To solve this, you must manually connect adb to running Genymotion Device In first, you need to know Androids internal IP. You can find it in window title of Genymotion device. Next:
cd to your Android SDK dir
cd to platform-tools
./adb connect 192.168.57.102:5555
where 192.168.57.102 is my IP address of Genymotion Virtual Device. You must put here your own
I killed the running adb process in task manager and the status of the genymotion device changes from booting to on. Finally the genymotion emulator can now be recognized.
just go to Control Panel\NetworkandInternet\Network Connections just c to that virtual host-only network is enabled and disable other duplicate virtual host-network which are with "#" and try to start again. It works for me
Try to run genymotion as administrator. It worked for me.But then you will not be able to add files to the emulator by using drag & drop feature.
Tryed solutions but none worked for me.
At the end run the genymotion as a administrator, now it's work for me.
Solution:
make sure there are no adb servers running. Use the command adb kill-server to kill any running server.
set Genymotion to Use Genymotion Android tools (default)
See: https://docs.genymotion.com/latest/Content/02_Application/Configuring_Genymotion/ADB.htm
This work for me.
I am very happy to be able to solve this problem, I can't work for 2 days with this problem.
One possible reason for the occurrence of this error is due to the difference in adb versions in the development machine and the connected connected device/emulator being used for debugging.
So resolution is:
Firstly disconnect device/emulator.
Run on terminal/command prompt following commands:
adb kill-server
adb start-server
This will start the adb successfully. Now you can connect device. Hope it helps.

Warning: debug info can be unavailable. Please close other application using ADB: Monitor, DDMS, Eclipse . ANDROID STUDIO [duplicate]

I am trying to debug an app with Intellij 13.0 on Windows 7.
Whenever I start debugging I get the following warning:
Warning: debug info can be unavailable. Please close other application using ADB: Monitor, DDMS, Eclipse"
I have tested it on a device and in the emulator.
The only thing I have open is Intellij. I tried also with closing adb before I start debugging, but nothing changed.
For me this situation occured when device was connected via usb and adb tcpip was enabled (ADB in Wi-Fi mode).
Just run command adb usb with connected device and try to debug again.
Turn the USB Debugging on Device in Developer Options to off.
And then switch it back on.
This solved the issue in my case.
UPDATE
One more thing which fixed my case was clearing all existing breakpoints. And then trying to debug again.
I used adb kill-server in the console to get the Logcat to appear. Running Android Studio 1.02.
For those who are using Android-Studio: check your gradle file and product flavours and be sure that "debuggable" attribute in manifest is NOT set to false.
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
if you cannt find terminal use this image to guide you
if this doesn't work with you close android studio and open it again
the cause of error , many application share ADB this why you cant start debugging
Had similar problem in Android Studio (0.5.1) with SDK 18.0.1
Warning: debug info can be unavailable. Please close other application using ADB: Monitor, DDMS, Eclipse
As you suggested updating the SDK worked. Now running on 19.0 and the problem got resolved.
You can restart ADB in windows without writing any commands.
Just open Task Manager
Sort the list by name
Find process named "adb"
Right click on it and then select "End Task"
Done
Next time you run any app the adb will start with a new instance.
A pretty straight forward solution is running the following commands in the command Terminal of Android Studio :
adb kill-server
adb start-server
and then try debugging again. It should be working now.
The same issues occured with me all of a sudden while debuging an app on my samsung galaxy S6
This is what worked for me :
closed android studio
killed adb , using adb kill-server
removed all of my previous breakpoints(debug points)
Restarted android studio and my phone
Restaterted Mac
did a debug without any breakpoint.
Then again did debug by putting the breakpoints again in my code, Eureka it worked. Luckily it burned only half hour of mine.
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.
Are you using adb through WiFi? That might cause debugging issues.
If so connect your mobile to your pc thru usb and debug again that should fix it.
This happened to me and the thing I did was to set
android:debuggable="true"
in <application> tag...like:
<application android:allowBackup="true"
android:label="#string/app_name"
android:screenOrientation="portrait"
android:largeHeap="true"
android:icon="#drawable/icon"
android:debuggable="true"
>
This fixed the problem with later SDKs.
Below steps worked for me(If you are connected via USB debugging),
Go to the Developer options of the phone
Disable USB debugging and all other authorisations for USB debugging.
Enable back all
Now try to debug again, hope it will work.

Cannot debug android app in Intellij: "Warning: debug info can be unavailable."

I am trying to debug an app with Intellij 13.0 on Windows 7.
Whenever I start debugging I get the following warning:
Warning: debug info can be unavailable. Please close other application using ADB: Monitor, DDMS, Eclipse"
I have tested it on a device and in the emulator.
The only thing I have open is Intellij. I tried also with closing adb before I start debugging, but nothing changed.
For me this situation occured when device was connected via usb and adb tcpip was enabled (ADB in Wi-Fi mode).
Just run command adb usb with connected device and try to debug again.
Turn the USB Debugging on Device in Developer Options to off.
And then switch it back on.
This solved the issue in my case.
UPDATE
One more thing which fixed my case was clearing all existing breakpoints. And then trying to debug again.
I used adb kill-server in the console to get the Logcat to appear. Running Android Studio 1.02.
For those who are using Android-Studio: check your gradle file and product flavours and be sure that "debuggable" attribute in manifest is NOT set to false.
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
if you cannt find terminal use this image to guide you
if this doesn't work with you close android studio and open it again
the cause of error , many application share ADB this why you cant start debugging
Had similar problem in Android Studio (0.5.1) with SDK 18.0.1
Warning: debug info can be unavailable. Please close other application using ADB: Monitor, DDMS, Eclipse
As you suggested updating the SDK worked. Now running on 19.0 and the problem got resolved.
You can restart ADB in windows without writing any commands.
Just open Task Manager
Sort the list by name
Find process named "adb"
Right click on it and then select "End Task"
Done
Next time you run any app the adb will start with a new instance.
A pretty straight forward solution is running the following commands in the command Terminal of Android Studio :
adb kill-server
adb start-server
and then try debugging again. It should be working now.
The same issues occured with me all of a sudden while debuging an app on my samsung galaxy S6
This is what worked for me :
closed android studio
killed adb , using adb kill-server
removed all of my previous breakpoints(debug points)
Restarted android studio and my phone
Restaterted Mac
did a debug without any breakpoint.
Then again did debug by putting the breakpoints again in my code, Eureka it worked. Luckily it burned only half hour of mine.
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.
Are you using adb through WiFi? That might cause debugging issues.
If so connect your mobile to your pc thru usb and debug again that should fix it.
This happened to me and the thing I did was to set
android:debuggable="true"
in <application> tag...like:
<application android:allowBackup="true"
android:label="#string/app_name"
android:screenOrientation="portrait"
android:largeHeap="true"
android:icon="#drawable/icon"
android:debuggable="true"
>
This fixed the problem with later SDKs.
Below steps worked for me(If you are connected via USB debugging),
Go to the Developer options of the phone
Disable USB debugging and all other authorisations for USB debugging.
Enable back all
Now try to debug again, hope it will work.

ADB not responding. You can wait more, or kill "adb.exe" ... windows 8

When I try to test my Android application with an android emulator as always I now suddenly get an error message. I'm working with Windows 8. So far I tried the following things which unfortunately could not solve the problem:
reinstalling eclipse with android adt
reinstalling java
installing "android studios" first solved the problem but after one day mysteriously also here adb, stopped working with the error message given in the title " ADB not responding ...
furthermore I unsuccessfully tried out some advice from Mr. Google:
Stopping adb.exe via task-manager and restarting eclipse / android studios
"adb kill-server" then "start-server" via command prompt
setting the path to adb.exe as an environment variable
switching off any antivirus or firewall
starting the IDEs as an administrator
updating the IDEs
The only thing I can remember doing which may have destroyed adb on my computer for all times: I connected my motorola smartphone to my laptop and installed the motorola usb drivers but as I said the adb also won't work with the emulator.
Any help would be kindly appreciated. The issue bothers me for more than an entire day now. Maybe someone had similar problems on Windows 8 ?
On OSX helped:
Close Android Studio
Kill all processess using 5037 port
sudo lsof -i |grep 5037
sudo kill PID_NUMBER
Run adb devices from console
adb devices
Meanwhile the emulator is working again. I cannot definetly say what solved the problem. What It could be a combination of two things:
Deleting the hidden ".android" folder under C:\Users...
(Probably there was some malfunctioning automatically created code)
Deleting and recreating the Path variable to the folder with adb.exe ( ...\sdk\platform-tools\;)
Finally it could be a Windows 8 issue which I don't understand.
Try this,
Open a command prompt with administration permission and type
netsh interface tcp set global autotuninglevel=disabled
This worked for me
Edit: Windows only
Kill the adb.exe with a command prompt. Open a command prompt were your adb.exe is located and type
adb kill-server
Maybe HTTP Proxy blocked the localhost 127.0.0.1:5037
If you have config the HTTP Proxy, make sure to exclude the localhost like picture below
Also, port can also be blocked by the firewall and anti-virus firewall, please notice as well.
Try this,
at the prompt try adb kill-server
Start one of your AVDs
at the prompt try adb root
The prompt should say adbd is already running as root.
That should fix it.
In case it helps anyone else, for me the problem was related with the USB hub that the tablet was plugged into on the computer (unplugging the webcam which was in use fixed it).
I got the same error. Don't worry. I have an solution. Go to Task Manager. Kill the process called adb.exe. You will find 2 or 3 processes. Kill all of them. You are done. It will work.
I have the same problems. Verify port 5037 is free and ports 5555 to 5585 are available and never used by another process.
"ADB server sets up connections to all running emulator/device instances. It locates emulator/device instances by scanning odd-numbered ports in the range 5555 to 5585"
FROM: http://developer.android.com/tools/help/adb.html
To find out which process is listening on a port on Windows yo can use:
C:> netstat -an -o
FROM: How can you find out which process is listening on a port on Windows?
I had the same problem, here is my simple fix:
-Go to task manager in windows, look for adb.exe, and kill it
-Go to command prompt, and tap adb devices ==> it will automaticaly start adb daemon
I finally just restarted the computer, and that solved the issue for me.
Uninstall HTC Sync. Or disable it somehow.
Try to open adb from command prompt from directory location as <sdk>\platform-tools,
If adb file is missing try to re-install Android SDK with latest version,
And try to run again..
I think issues will solved, by this procedure.
I saw this on a Mac OS X.
I shut down Android Studio and ran adb get-state in the terminal. When I started Android Studio back up, the warning had gone away.
BTW, I did just try restarting Android Studio without any luck. I am sure a restart of OS would have fixed it too.
The same thing with the Asus Sync utility (with the both our Transformer's 700 and 701).
I think there is a USB-port conflict between ABD driver and Sync utility.
Exit from Sync utility resolve the problem.
Looks like this could be caused by a bunch of different issues. This just happened to me because I had my android phone device plugged in for USB debugging, then after a few hours (and multiple android studio/phpstorm restarts) I had to do unplug the device manually. Things started working again after unplugging.
I have faced this problem few days ago. When I opened my task manager it showing me two adb runnig. It may be because of I am using mobogenie for connecting my android phone for debugging application. This problem is because of moboginie and adt port conflict. then I have followed following procedure to sort out this issue.
!) close eclipse
2) Go to task manager and kill all adb processes.
3) Now go to platform-tools in android sdk
4)press shift+right click mouse and select "open command window here" option
5) type
adb kill-server
adb start-server
6)if server sucessfully started then start eclipse and then connect your phone
(Remember dont connect your phone before starting eclipse)
Following works for me every time:
go to File->Invalidate Caches/Restart
select Invalidate and Restart
And, You are good to go.

Categories

Resources