During my revisit to app building for the Android platform I started to notice that the emulator (when using Eclipse) was a bit hit and miss when it came to loading the freshly compiled applications onto it. After much surfing on the web I had found that some folk had seen partial succes when killing the adb server. I played with this and I too had some partial success. Then after much trial and error I struck upon a solution that works everytime… it’s not pretty but it does do the job.
The Solution – Installing apps on the emulator
So what I do is this;
- Start eclipse
- Start the emulator… let it get to the point where it is fully loaded (i.e. at the home screen)
- From the command prompt kill the adb server with the command adb kill-server. This adb command is in my C:Program File/Android/app-inventor-extras folder on my windows setup (your may be different)
- The above command will cause eclipse to try 11 times to re-initialise the emuulator link. While this is happening (and after) I click the run button… I do this every second until the output in the console tells me that my app is being installed.
- Voila!
And that’s it… like I said it’s not pretty but it does mean that my apps install onto my emulator. Note this only needs to be done once, perhaps to set up the link between eclipse and the adb.
Can u please explain me step 3 exactly?
I dont find anything about the adb command, or something which i can type in.
Thanks
Hey CD,
adb is an executable tool provided with the Android SDK. It is usually found in the tools folder of your SDK installation (for example C:Userstoddandroid-sdk-windowstools on my Windows Vista setup). So to use this open the command prompt run the command (so I could run for example C:Userstoddandroid-sdk-windowstoolsadb kill-server).
Hope this helps,
Todd
thanks for the solution!i want to ask you if i have to do this thing for all my apps for the first time!
Hey mixalis, sadly I have to do this quite often… not everytime for sure but most times for the first compilation/loading after starting the emulator.
You saved my life !
hey Todd
i tried that thing earlier it works. after running one application when i try to run second application it shows something like “Could not open Selected VM debug port (8700). Make sure you do not have another instance of DDMS or of the eclipse plugin running. If
it’s being used by something else, choose a new port number in the
preferences.” when i sort out this thing a new error shows something like this in DDMS
Failed to install IfElse.apk on device ’emulator-5554′: device not found
com.android.ddmlib.InstallException: device not found
Launch canceled! when i sort out this error and deleted all the project and form a new defaul hello world project . emulator not install it. i tried adb kill-server and adb start-server but no action don’t know what to do?
with regards
ajay
Hey Todd,
I’ve just started with android development. The app launch icon doesnt show up in the emulator when i run the app. This is my first app. No error is reported in the console. Perhaps the app is not installed. What do u think is the problem here? Any idea how to resolve this?
Help!!
Thanks,
vish
Thanks man you just saved my time..
God bless you
You saved my life dude!!!
Here is what i did. I used adb kill-server and then again started it using adb start-server. Next time when i run the application, i am able to launch it in eclipse.
Thanks for the tip!!!