`

Intellij IDEA android-x86开发

阅读更多

 

安装虚拟机android过程比模拟机快不少。

http://www.cnblogs.com/MaxWoods/archive/2011/09/16/2179310.html

 

如果想删除这些映射,同样执行以上的命令,而把最后的命令值留空即可,如:

VBoxManage setextradata "android" "CustomVideoMode1"

 

如果修改启动模式不成功,也可以直接在Debug模式下

启动之后,我们可以将 boot 分区以 read/write(读写)模式重新挂载,以便于修改 Grub 配置。

mount -o remount,rw /mnt

然后可以编辑 menu.lst 文件。

vi /mnt/grub/menu.lst

在第一个kernel的最后添加 vga=ask

网络采用桥接方式

我们的目标是能够从 Intellij IDEA 中使用 AVD 调用新的 VM 来测试和调试应用。为了做到这一点,网络配置必须允许主机(运行Intellij IDEA的机器)和 VM 之间的连接。为此,在 VirtualBox 的 Network settings(网络设置)中我们有几个选择:

  • use Bridge mode(使用桥接模式):模式可行,但是需要宿主机配置 DHCP 服务器;
  • host only network(仅与宿主机有网络连接): 在 VM 和宿主机之间使用内部网络;这是最简单的方案。

enter image description here

一旦设置好网络,按照如下设置即可。

 

Debugging an Android x86 application using Intellij

OK, you decided to drop the incredibly slow Android emulator that comes with the official SDK and you are now happily using Android x86… but how do you debug your Android application using Intellij ?

That’s a good question ! (By the way, if you may want to check my last post if you need help running Android x86 in VMWare player).

First, you need to know the IP of your Android x86 VM. To do this, hit ALT-F1 in the VM and use the ‘netcfg’ command to know the IP address given to your eth0 device:



 

You can then hit ALT-F7 to go back to the Android UI.

Then, in your host PC (the one that is running Intellij), execute the ‘adb connect [ANDROID_X86_IP]” to connect the SDK debugger to your Android x86 VM:



 

Now go back to Intellij, display your run configuration and make sure that the “show chooser dialog” option is selected:



 

You are almost done: add a breakpoint in Intellij, launch the application in debug mode and then select your Android x86 device in the “choose device” dialog:



 

 

 

 

 

 

 

 

 

  • 大小: 1 KB
  • 大小: 1.6 KB
  • 大小: 54.6 KB
  • 大小: 11.8 KB
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics