This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Eclipse Error: “Failed to connect to remote VM”
I am using Eclipse to dip my toe into Android development. All going well but recently, I am not able to use debug anymore. When I click 'Debug As' - 'Android Application', app builds ok, installs ok but Android device (either actual device or emulator, it makes no difference) waits with 'Waiting For Debugger' with a single 'Force Close' button. In the console, I get something like:-
[2011-08-26 11:59:59 - Sunrise] Starting activity
com.sr.sunrise.Sunrise on device 3833CB14F52C00EC [2011-08-26 11:59:59
- Sunrise] ActivityManager: Starting: Intent {
act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER]
cmp=com.sr.sunrise/.Sunrise } [2011-08-26 12:00:00 - Sunrise]
Attempting to connect debugger to 'com.sr.sunrise' on port 8614
[2011-08-26 12:00:00 - Sunrise] Launch error: Failed to connect to
remote VM
I have followed many searches (including this one
StackOverflow.com link
and this
StackOverflow.com link2
and I have tried many suggestions but nothing has fixed this problem yet.
Can anyone help me as this is now stopping me from creating my masterpiece ;-)
This just worked for me:
Close Eclipse.
Remove USB.
Go to task manager, and delete all 'eclipse.exe' (in my case I had 4-5 instances).
Also delete 'adb.exe'.
Restart Eclipse.
Reconnect USB.
Maybe this will work for others who have the same problem.
THIS IS PRETTY MUCH THE NUCLEAR OPTION...
I had the same problem on my macbookpro, I don't know exactly how to fix it data loss, but on my system, I "rm -r ~/.android", recreated my devices, and I can again debug.
It is important to note that this is destructive in that the .android directory is where the android emulator is saving the state of the devices I am emulating.
I think the root cause of the problem had something to do with an old android SDK that I removed from my system when I downloaded the android-sdk_r15-macosx.zip leaving some cruft around in the .android directory.
Related
First of all, this is my first post here and I'm a beginner so my apologies if this ends up being a stupid question or my format is wrong, but any help is appreciated.
Essentially my problem is in trying to set up Unity Remote 5 for debugging in Unity. However, I believe I've finally narrowed it down. The error I'm getting now seems clear:
CommandInvokationFailure: Unity Remote requirements check failed
C:/Program Files/Unity/Hub/Editors/2019.4.17f1/Editor/Data/PlaybackEngines/AndroidPlayer\SDK\platform-tools\adb.exe forward tcp:7201 tcp:7201
stderr[ error: device offline]
stdout[]
exit code: 1
I've looked into this error and came upon this: https://stackoverflow.com/a/39031464/14948855 which seems like it might be useful to me, however the issue is I don't know how to run the commands he suggested and stack overflow made it clear it didn't want me posting a question as a response to that question and I don't have enough prestige to comment.
I'm trying to run "sudo adb kill-server" from an ubuntu linux terminal on windows from the directory abd is in (C:\Program Files\Unity\Hub\Editors\2019.4.17f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools), but it won't run.
proof command not found
I've tried adding it to the path on my computer: I added the directory listed above to "Path" in my "Environment Variables".
My phone is plugged in, I've disabled and reenabled developer mode and usb debugging, and restarted Unity and my phone several times. Any help with running this command in ubuntu or cmd, or even the greater problem of Unity Remote 5 would be fabulous.
Thank you.
Edit: here's a better image showing my issue:
image showing how I've tried to add the folder to the path but it still can't be reached
Final Update:
All my problems have been solved, here's how I got unity remote 5 for android working for posterity:
step 1) Make sure phone is in developper mode (go to "about phone" in settings, tap build number 7 times).
step 2) Make sure "USB debugging" is turned on in developer options.
step 3) Make sure Unity is updated to the most recent supported version through Unity Hub (might not be required but I did this step).
step 3) Download android support module through Unity Hub.
note: if you downloaded current Unity version from the Unity website rather than through Unity Hub, it doesn't seem to let you add modules to it through Unity Hub.
step 4) The sdk path Unity specifies by default is wrong for some reason, so in preferences->external tools, disable the default path and paste in the right directory (should be something like: C:\Program Files\Unity\Hub\Editors\2019.4.17f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK) to be safe I did this for the JDK, NDK and Gradle too.
step 5) When you plug in phone, pull down your notifications, hit "tap to change USB options" and make sure phone is in "camera" mode or some variation. For me it was "Photo transfer".
Note: if you don't have the option to change USB options, try different usb ports/cables, if those don't work you might have debris in your charging port, clean it out with a dab of 91% or 99% rubbing alcohol and a tooth brush/tweezers (this will also make charger sit more snug in phone)
That might be enough to get it working for you, if not...
step 6) (Not sure if necessary) May need to update phone drivers in device manager on windows.
step 7) If Unity gives an adb error saying too many devices connected, it's possible you have a daemon running in the background which adb is picking up as an android emulator because it's using a port greater than 5555. It seems adb checks open ports above port 5555, and assumes anything it finds is an emulator. To check this, as indicated in my original question, and as stated here: https://stackoverflow.com/a/39031464/14948855, in cmd on windows use adb devices (if ur on linux may need to use sudo) to get a list of all devices being detected by adb. (Also use "adb kill-server" to reset it.) If there is an emulator being detected, it should include the port it's using in its name, in my case it was "emulator-5562" in port 5562, which was apparently actually NTKDaemon from Native Instuments, a random music production program I've only used once so far. I'd suggest googling the emulator port you find to try and narrow down the process taking that port. The only thing left to do is to kill the process running in the port. I found NTKDaemon in task manager and also disabled it activating on startup because that's just evil imo.
And that should be it. Hope that works for you if you're here for help.
(btw in terms of my original question, I was able to access adb.exe by changing the directory in cmd, but I still never found why adding the directory to the path didn't work, so if anyone has an answer to that I would be interested)
This question already has answers here:
Error "The connection to adb is down, and a severe error has occurred."
(39 answers)
Closed 7 years ago.
The connection to adb is down, and a severe error has occurred.
You must restart adb and Eclipse.
Please ensure that adb is correctly located at '/home/ASDK/platform-tools/adb' and can be executed
WHAT SHOULD I DO?
this question was raised by me and here I am explaining my experience.
Actually this question was raised when one of my friend was trying to setup android on his laptop but his micromax mobile could not be detected for debugging. he is just a teen eager. I suggested above answer and some other solutions to him one of which is installing mobomarket mobile synchronization software (used for micromax mobiles- a company whose adb driver can not be installed automatically).
He install that s/w but facing this error every now and then. one thing he observed that this s/w installed req adb driver for micromax mobile. but port no 8700 on which adb process used to run was occupied by this new s/w.
so he made very good assumption that if he uninstalled the s/w driver will not be uninstalled. and trick works. good thing is that he completed his whole android app without facing this error.
hope this trick will help you all.
This question already has answers here:
Adb won't start
(21 answers)
Closed 6 years ago.
I have this problem every now and then, it says "ADB server didn't ACK, failed to start daemon".
So First, I followed some instructions to reset the adb in DDMS, AND then it gives me "adb failed to start, make sure the plugin is properly configured".
After reading some other solutions, I kill the adb.exe in my task manager, but it became alive again after 2 seconds.
I have restart my eclipse and pc couple of times, still no luck.
anyone know whats the problem? I am using win8, don't know if it the problem...
You can solve this issue by following below mentioned steps
Go to Task Manager and kill adb.exe from Process tab
Go to DDMS->Devices tab in eclipse and select option Reset adb.
Your emulator will come in Online and can go further.
If this should not work, try restarting Eclipse and the emulator, and try the steps again.
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Android error: Failed to install *.apk on device *: timeout
keep getting error messages when I try to launch any mobile app with android. These errors are not predictable - sometimes (like once out of 10 times) a miracle happens and everything works. But most of the time I get this error:
[ERROR] C:\Program Files\Titanium Developer\android-sdk-windows\tools\adb.exe
error: protocol fault (no status)
followed by this error later on:
[DEBUG] Waiting for device to be ready ...
[TRACE] adb devices returned 0 devices/emulators
......
[ERROR] Timed out waiting for emulator to be ready,
you may need to close the emulator and try again
The emulator starts and I get the locked screen but somehow the connection with it is lost.
I tried launching the emulator separately from a batch file as someone else suggested before I open the ti developer but I get the same errors.
Even if it runs correctly once, if I make changes and want to relaunch (without stopping or closing the emulator) I always get the errors above. I thought we are supposed to be able to keep reusing the emulator once it's up and running but for me it never works like that.
When i try to run from eclipse it used to give the following message Failed to install Demo.apk on device 'emulator-5554': timeout
I want to run the same application without killing adb server or without closing the emulator again.
Please any help would be appreciated lot!!!!!!!!!
That's because the default ADB idle time out is 5000ms.
Take Window -> Preferences -> Android -> DDMS. Increase your ADB time out. This will solve your problem
Delete the .android folder from your home folder of user after closing eclipse and emulator and then restart and try. It should resolve your problem. After deletion you will have to set the sdk of adt plugin.
I'm trying to work through their notepad tutorial and it describes how the Eclipse project should automagically build and re-generate the auto-generated code when a file is saved. That wasn't happening, and looking at their debugging, they suggest the "reset adb" link in the DDMS perspective in the Devices panel. When I try to do that, I get the following output which I assume is bad:
[2010-01-03 23:09:51 - DeviceMonitor]Adb connection Error:EOF
[2010-01-03 23:09:51 - DeviceMonitor]Connection attempts: 1
a quick Google didn't reveal anything particular useful. What are the next debugging steps and/or what might be the issue?
UPDATE: So this actually isn't a problem like I thought it was, but I'd still be curious what this message means if anyone knows.
DDMS uses a long-lived connection to the adb server running locally to get info about connected devices/emulators etc. The error message you posted generally just means that the connection to adb has been lost.
Because you ran the reset command, you essentially just killed and restarted an adb process, so Eclipse showed that harmless warning for a moment.
You can see this yourself by killing the adb process manually. Eclipse will show Connection attempts: n for about 10 attempts before giving up.