Android emulator uses 100% cpu even if nothing i running on it ?

前端 未结 10 2000
感情败类
感情败类 2020-12-13 06:01

I have a celeron processor :/ and android emulator on eclipse uses 100% of cpu and hangs everything unless I kill it . I was just trying a hello android program from a book

相关标签:
10条回答
  • 2020-12-13 06:24

    As others have said, the solution is disabling sound. Unfortunately, in recent Android Studio releases (I'm using 1.4) the option to disable sound has been removed from the GUI. To disable sound you can do it either by launching the emulator from the command line with the -noaudio flag, or by editing the AVD's config file and setting the following parameters:

    hw.audioInput=no
    hw.audioOutput=no
    

    On Linux, I found that file at ~/.android/avd/myAVD.avd/config.ini

    0 讨论(0)
  • 2020-12-13 06:28

    I had same issue on my macOS High Sierra and for me helps to create new AVD device and choose CPU/ABI = x86_64, not x86 in Android version dialog. Hope that helps.

    0 讨论(0)
  • 2020-12-13 06:28

    I had this issue running the emulator on Ubuntu 14.04. Disabling the audio does bring down the CPU usage, but in case you need audio to work, it can be fixed by adding a symlink:

    sudo ln -s /usr/lib/x86_64-linux-gnu/libpulse.so.0 /usr/lib/x86_64-linux-gnu/libpulse.so
    

    The reason for this is that the emulator tries to use pulseaudio as the backend, but will be unable to link to libpulse.so, which does not exist on Ubuntu (unless you installed the libpulse-dev package). Then it will fall back to ALSA, which constantly calls poll, causing 100% CPU usage.

    A fix for the emulator is coming, but for now, adding the symlink solves the issue.

    0 讨论(0)
  • 2020-12-13 06:30

    I've had the exact same problem and found a solution that works for me. In the config of the AVD I've set an extra flag "Audio playback support" to "no". I've also made sure the AVD has 1GB of RAM.

    This worked for me.

    0 讨论(0)
  • 2020-12-13 06:30

    For me, it was unchecking the Multi-Core CPU check box

    0 讨论(0)
  • 2020-12-13 06:36

    The Android emulator is emulating an ARM CPU without hardware acceleration which can be pretty slow even on a core2duo for example.

    You can try to reduce the screen resolution of the virtual device which should result in a small performance increase.

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