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.
Related
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
I read many posts to fix this problem. None worked for me.
Error:
Target device: lenovo-lenovo_a6000-89a70dc9
Installing APK: C:\Users\Nikhil\AndroidStudioProjects\ProfitKey\app\build\outputs\apk\app-debug.apk
Uploading file to: /data/local/tmp/helix.profitkey.hotelapp
java.io.IOException: An existing connection was forcibly closed by the remote host
I tried below
Kill and start adb
Invalidate and restart android studio
Removed adb process in the taskbar
Restarted the device and pc
Restarted studio, clean and rebuild
Taskbar have only one adb.exe
Updated the driver from device manager
Another device it is working. But previously both device worked fine for me.
Target device: motorola-xt1022-ZX1B33PRVP
Installing APK: C:\Users\Nikhil\AndroidStudioProjects\ProfitKey\app\build\outputs\apk\app-debug.apk
Uploading file to: /data/local/tmp/helix.profitkey.hotelapp
Installing helix.profitkey.hotelapp
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/helix.profitkey.hotelapp"
pkg: /data/local/tmp/helix.profitkey.hotelapp
Success
Edited:
I tried with two lenovo A6000. One is working and another is not working. Then, Moto is working and samsung galaxy is not working. Whenever I am killing and starting the adb. The task manager creating two adb first and after few seconds one was hiding. Was this a problem? But still some devices working fine.
adb starts automatically after killing by command or from the task manager if android studio is opened.
Now working for all the devices. Just I uninstalled the driver of mobile in PC and changed the port to connect with that device. I think some problem with the port in my PC. After long research it fixed by a small thing. It might be helpful to someone.
I also faced same problem,this was a just port problem,I was using computer front USB port ,just use computer back USB port and problem solved.
Restarting adb.exe worked for me. (For windows, Just Go to taskManager and kills the adb.exe process and re-deploy)
I also faced same problem, just change computer USB port and problem solved. or use genymotion emulator
I closed my virtual devices, opened windows task manager, and killed all adb.exe tasks -- there was one constant one and another that would appear then disappear. Aftwerwards, i started my virtual device and everything worked again.
Make sure that no other program is trying to take control of the ADB. You can check this by opening task manager, right clicking on any of the adb.exe, and opening the file location. Turns out that my HTC sync manager had it's own ADB and wanted to run it all the time. I uninstalled the program and haven't had issues since.
In my case, I had to change the USB debugging cable.
Until yesterday everything was working perfect until today that I connected my phone (just updated to Jelly Bean) and adb.exe stop working. If I execute adb.exe I can see the help but when I want to use any command it just run forever and no message is shown.
I tried with "kill-server" and "devices" and it runs forever, no message at all is displayed and I must terminate the process to close it.
I just connect the same phone to other PC that was fully functional and also adb.exe stop working. The strange thing is that adb.exe will not work any more even If I disconnect the phone and/or I connect my tablet. Adb.exe just got useless.
I was using the same phone yesterday (android 4.0), with my tablet (android 4.2) and adb.exe was working.
Adb.exe is not corrupted as I checked it MD5 and it is the same as in working pc (5787e5df1a68e7afea82d58e5f0d6549 *adb.exe).
I have Android Debug Bridge version 1.0.31 and Android SDK tools 22. I uninstalled android sdk tools and Installed again but when is near to finish it hangs because it launches adb.exe and again it will run forever.
Please any suggestion or help?
Try rebooting. Sometimes the USB drivers lock up. I work HEAVILY with ADB in my project at http://android-casual.googlecode.com and I find it to be one of three things when ADB locks up.. 1. USB drivers, or 2. adb_usb.ini needs an update, or 3. on new devices you have to "pair" them so that ADB can perform any action.
To pair, you can disconnect, reconnect and run "adb devies" to display the pairing on the device.
Not sure if you're still facing this issue, but for what it's worth I had the same kind of issue with adb.exe, and came across this post while trying to troubleshoot it. In my case, I wasn't using any physical Android devices, only the Emulator. Everything had been working fine and then suddenly adb.exe would no longer respond (couldn't get any output from any adb command - it just appeared to hang).
In the end, my issue turned out to be another application I had installed on my development machine. It was starting as a service, and was listening on the exact same port that the adb server runs on (5037), which appeared to be confusing it. Once I changed the application to use a different port, adb started working again and everything was fine.
Run command
where adb
I had such kind of situation.
In my case
where adb
gave output
C:\Windows\adb.exe
D:\AndroidSDK\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb.exe
I tried to run adb from disk C, when Eclipse used second adb from AndroidSDK (from disk D).
I removed adb from strange path C:\Windows\adb.exe, and this solved this problem.
I got the same problem,my solution is going to cmd and paste adb.exe path,and then click enter button.For example
D:\Android\Android\platform-tools\adb.exe
A few days ago I started having troubles while trying to install a .apk on my Galaxy S2. I select my phone as the target, click OK and in the Console get the following error:
Failed to install AvatarRun.apk on device 'device number': timeout
Launch canceled!
Without changing anything in code and running again I can also get the error:
Failed to install AvatarRun.apk on device 'device number': device not
found com.android.ddmlib.InstallException: device not found Launch
canceled!
I have tried opening a command window and navigating to android-sdk\platform-tools and running:
adb kill-server adb start-server
This did not fix the issue.
This seems to just be a coincidence, but after failing many times I changed the minimum SDK in the Manifest from 10 to 7 and the .apk loaded on the next try, but has worked intermitently since and generates the same errors.
Can anyone suggest a method for finding what is causing this error?
After trying the fixes mentioned above, I ended up installing and reinstalling the Galaxy drivers. This didn't help. What eventually worked (so far) was to switch which USB port the Galaxy is plugged into. Once I did this everything was functioning as it should.
It may sound ridiculous, I tried all the ways suggested in Android error: Failed to install *.apk on device *: timeout
None of them works for me except unplugging the current cable and change for a new one.
There are various solutions:
Try changing the ADB connection timeout. The default is 5000; you should change it to 10000ms or so.
Window -> Preferences -> Android -> DDMS -> ADB Connection Timeout (ms)
Try to unplug and re-plug the cable. It seems that sometimes Eclipse loses the connection with Device. Sometimes you just need to plug into other USB port.
You might need to kill the ADB process and restart it.
adb kill-server and then
adb start-server
For me, the solution is to uninstall the old apk from the phone.
This problem often shows up if the computer is not fast enough. So,if you go to task manager you will see the performance. If you are watching video or running other programs at the same time while you are running your android application close other programs; at least during installing the app on device or emulator. You might even need to close internet browser.
You might need to update your computer to make it faster if you can.
Hope this helps someone:)
I'm new with android development, and I have problems installing all the recent platform. I'm a java developer that I would like learning android.
I've installed all programs succesfully in windows xp sp3 (JDK 1.6 with environment vars created, eclipse 3.5, 3.6 & 3.7 well configured, Android SDK with all the features, devices, platform-tools, APi's, etc, and ADT Plugin 12 for eclipse with an emulator to API 8 -Target 2.2-), but, when I'm running an android project into eclipse (Run -> Android Application), the eclipse console show me: "The connection to adb is down, and a severe error has ocurred... You must restart adb and eclipse... Ensure that adb is in this path 'D:\Android\android-sdk-windows\platform-tools\adb.exe'" (or something similiar).
I'm very sure that the path is right, adb is correctly running on command-line, and the commands 'adb kill-server' and 'adb start-server' works fine, but doesn't solve my problem (like I've read in other answers).
The emulator, via Eclipse, not working, but if I start the emulator via Eclipse ADV Manager, emulator starts fine, but when I runs the android app, I take the same error.
I suppose that Eclipse can't start adb,but I don't know why.
Other issue, when I executed 'adb devices', console show me an empty list, no 'no devices' message, but when I plugged my HTC, adb is running fine in console, but Eclipse doesn't.
In addition, I also try restarting adb with Eclipse - Devices tab, but the list of devices are empty too.
Anyone can help me, please? I've read so much that my eyes are pixelated. xD
Best regards!!
PD: sorry, but my english is a bit poor ;)
in the DDMS perspective (if it doesn't show, add it by click window>open perspective>other...>DDMS)
then click the triangle of the devices tab > reset adb.
this works for me.
I finally resolved the problem, please see my blog
you can do this steps to solve the problem:
task manager-> process
right click on adb.exe and left click on "properties"
check the path of the process:
-if the path is like "Programs\android-sdk\platform-tools", which means it is the android sdk that is running this process.
-if not, that means there is another process this is running adb.exe, you have to kill the process or service which runs adb.exe.(you can identify the process by the path)
I've had this problem too. The solution I've found is to kill eclipse, open up task manager and kill the adb.exe process. Then when you start eclipse again, that should also kick start adb and it should work from there.
Try the following steps :
- Close Eclipse IDE
- Go to the Android SDK platform-tools directory in Command Prompt
- run adb kill-server
- run adb start-server
- Now start Eclipse again.
Hope this may help you :)
In my case, in Windows7
Close all opened emulators
Go to task manager > processes and then click on adb.exe and press the button 'end process'.
Then go to command prompt go to plate-form tools and type
adb start-server
Then run your application through eclipse.
It worked fine for me.
you try
Open Task Manager > Processes > eclipse.exe > End Process > restart eclipse
In my case the problem was the FIREWALL!.Turn off your windows firewall , Then restart adb and eclipse from task-manager