開發環境: windows 2008 R2 x64, JDK 7u10, ADT v21.0.1-543035
一.啟動 Nexus 7 模擬器失敗
模擬器啟動出現如下錯誤:
Starting emulator for AVD 'nexus7'
Failed to allocate memory: 8
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
網絡搜索解決:
來源:http://code.google.com/p/android/issues/detail?id=36080
方法:用命令行啟動,指定內存為 512M,默認1024M有問題
c:\xxx>emulator -avd nexus7 -memory 512
二.GUI 響應非常慢
模擬器啟動出現如下錯誤:
Starting emulator for AVD 'nexus7'
emulator: ERROR: Could not load OpenGLES emulation library: Could not load DLL!
emulator: WARNING: Could not initialize OpenglES emulation, using software renderer.
界面操作,響應很慢
網絡搜索解決:
來源:http://stackoverflow.com/questions/11674306/eclipse-android-emulator-wont-launch
原因是未指定類庫地址相關環境變量
方法:添加變量定義:LD_LIBRARY_PATH=/home/xxxx/devel/android-sdk-linux/tools/lib
為此,新建一個批處理來啟動模擬器 em.bat,存放在sdk的tools目錄下,如下:
setlocal
set LD_LIBRARY_PATH=K:\android\ide\adt-bundle-windows-x86_64\sdk\tools\lib
emulator.exe -avd nexus7 -memory 512 -gpu on
開發中,先用命令行啟動模擬器,再在運行調試時,選擇當前運行的AVD即可.