chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
08/12/13 03:11 PM (12 years ago)

fix: issue with Eclipse/Android Studio not recognizing emulator

Not sure if anyone else has this problem, but for me whenever I try to run the emulator from Eclipse or Android Studio, it will start up, but before it gets to the phone's homescreen Eclipse/Android Studio stops recognizing it. My first solution was to close out of the emulator and run the app again, opening a new emulator back up and hope for the best. About 50% of the time it would work. Next I found if I simply ran "./adb kill-server" and then "./adb start-server" in Terminal from my platform-tools directory while the emulator was runnig, it would solve the issue. This made things much easier - but still I had to open terminal and change to the platform-tools directory and run the commands - every time I started working on Android stuff - still kind of a pain. So, now I have a new solution. I wrote the following AppleScript to automate this for me. You'll need to change the path to your platform-tools directory to work on your machine. And if you're like me, you'll want to save this as an Application from AppleScript and stick it on your dock! :) tell application "Terminal" activate delay 1 do script "cd '/Users/USERNAME/Documents/android-sdk-macosx/platform-tools/'" in front window do script "./adb kill-server" in front window delay 1 do script "./adb start-server" in front window delay 5 end tell tell application "Terminal" to quit
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
08/12/13 03:19 PM (12 years ago)
Nice. I was rebooting, lol! Thanks! Cheers! -- Smug
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
08/12/13 03:43 PM (12 years ago)
good - glad I could help someone else out in this! That was one of my biggest frustrations with Android development.
 
Susan Metoxen
buzztouch Evangelist
Profile
Posts: 1706
Reg: May 01, 2011
Hopkins, Minnes...
26,260
like
08/12/13 10:21 PM (12 years ago)
Thank you, Chris!
 
ictguy
Aspiring developer
Profile
Posts: 564
Reg: Jun 17, 2011
Mildura, Austra...
15,840
like
08/13/13 05:03 AM (12 years ago)
I've been using your first solution ... it gives me plenty of time to get a cup of coffee :) I once heard someone describe the Android Emulator like this: "It runs like a dog - like a dog that has been shot in the back leg!" A very accurate description!! :) Thanks for the Apple Script! Cheers Darrel
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.