Eclipse keeps starting new emulators

后端 未结 6 645
南方客
南方客 2020-12-24 14:16

I\'m busy learning how to build apps for Android, and I come across a very awkward problem.

When I run my application (with the green circle with the play-icon in it

相关标签:
6条回答
  • 2020-12-24 14:34

    Go to Command prompt and set the path where the adb is stored and give the following command: First kill the adb by giving the command adb kill-server and then start the adb by giving the command adb start-server(for windows) Otherwise there is another option Go to DDMS and restart the adb.

    0 讨论(0)
  • 2020-12-24 14:35

    If the emulator has started, that may mean adb is acting up. Not sure on windows, but on mac/linux I do the following:

    adb kill-server
    sudo adb devices
    

    You could try that (get rid of the 'sudo' business).

    0 讨论(0)
  • 2020-12-24 14:37

    After starting the emulator, check the emulator name has been reflected in Eclipse->DDMS->Devices. If it is mentioned as "Online", you can just run the application and it wont launch new emulator. If it is mentioned as "Offline", go to "View Menu" option(a small down arrow button in Devices window) and reset the adb. This will restart adb and will make emulator Online.

    0 讨论(0)
  • 2020-12-24 14:39

    I don't think you're waiting long enough. There's 3 stages to go through

    • Wait until the android logo disappears on startup (unless you've disabled boot animations)
    • Wait for the locked screen to come up.
    • Wait for the app to be actually installed onto the device (you'll get a message saying 'Installing nameOfApp on Emulator device #whatever')

    This whole process will take anywhere from 3 - 15 minutes. To speed things up, make sure you leave the emulator ON then you just need to do step 3.

    If you try to click Run again before this is all done, it will incorrectly assume no emulator is up and start up a new one.

    You can also make sure your emulator is ok by selecting Window -> Android SDK and AVD Manager and selecting Virtual Devices. You can even start a device up first (stages 1 and 2) without actually installing your app. You can also check the status of the device using DDMS (and make sure that it isn't actually installing your app and then silently crashing) by selecting DDMS at the top-right of Eclipse or Window -> Open Perspective -> Other -> DDMS

    Hope this helps.

    0 讨论(0)
  • 2020-12-24 14:41

    best way to just kill the current running server

    adb kill-server
    
    0 讨论(0)
  • 2020-12-24 14:51

    I do not believe what you are witnessing is a bug at all.

    You probably do not need to restart the adb.

    What is happening is this:

    If the current emulator you are running does not fit the minimum SDK of project you trying to run. The Android SDK manager will run an emulator that does fit the minimum sdk requirement.

    0 讨论(0)
提交回复
热议问题