Android 开发时遇到的两个模拟器问题

开发环境: 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即可.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值