虽然google的android sdk 提供 intel system image下载,但在我的笔记本上允许由此创建的AVD是不行的,一直处于等待状态(HAX failed)。
后来查资料,发现要运行android 的intel 虚拟机,需要打intel的补丁 intel-hardware-accelerated-execution,下载地址:https://software.intel.com/en-us/android/articles/intel-hardware-accelerated-execution-manager-end-user-license-agreement。
安装前必须保证你的电脑打开了虚拟技术的开关(在BIOS里面), 一般intel i5都会有这功能。 补丁安装完毕,查看其服务是否正常运行:sc query intelhaxm 。
然后打开ADT随便调试一个APP,选择target为这个AVD,在console里面看到:
[2014-05-05 11:29:28 - Emulator] HAX is working and emulator runs in fast virt mode
[2014-05-05 11:29:29 - BBW] New emulator found: emulator-5554
[2014-05-05 11:29:29 - BBW] Waiting for HOME ('android.process.acore') to be launched...
[2014-05-05 11:32:35 - BBW] HOME is up on device 'emulator-5554'
[2014-05-05 11:32:35 - BBW] Uploading BBW.apk onto device 'emulator-5554'
[2014-05-05 11:32:52 - BBW] Failed to install BBW.apk on device 'emulator-5554': timeout
[2014-05-05 11:32:52 - BBW] Launch canceled!
[2014-05-05 11:33:05 - BBW] ------------------------------
[2014-05-05 11:33:05 - BBW] Android Launch!
[2014-05-05 11:33:05 - BBW] adb is running normally.
[2014-05-05 11:33:05 - BBW] Performing com.freestyle.BBW.activitys.MainActivity activity launch
[2014-05-05 11:33:05 - BBW] Uploading BBW.apk onto device 'emulator-5554'
[2014-05-05 11:34:08 - BBW] Installing BBW.apk...
[2014-05-05 11:35:39 - BBW] Success!
[2014-05-05 11:35:39 - BBW] Starting activity com.freestyle.BBW.activitys.MainActivity on device emulator-5554
[2014-05-05 11:35:39 - BBW] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.freestyle.bbw/com.freestyle.bbw.activitys.MainActivity }
[2014-05-05 11:35:39 - BBW] Attempting to connect debugger to 'com.freestyle.bbw' on port 8617
官网说加速能力可是啪啪啪的牛掰,但看上面的日志,从启动AVD到APP开始运行,经历了6分钟!!!
好了,android intel的AVD可以顺利运行,然后测试含有android jndi调用的app。传说intel cpu兼容绝大多数数arm的指令,可以无需重新编译即可用intel通过一套转换代码运行arm指令集!但经测试证实这是浮云,加载.so文件那刻已经报错了,必须用android+i386重新编译的,不知道真机怎么样!
intel core i5 + 4G 的联想笔记本跑ADT+AVD 慢的跟牛似的,不知道8GRAM会怎么样??