android x86debug,Debug HowTo | Android-x86_weixin_39831170的博客-程序员宅基地

技术标签: android x86debug  

Android-x86

Run Android on your PC

light_theme.png

dark_theme.png

Debug Howto

This page explains how to use adb and gdbserver with VirtualBox

1. use adb:

• In the VirtualBox network configuration, it is simplest to configure it for Host-Only or Bridged.

• boot up Android iso image on the VirtualBox.

• setup ethernet (normally, it will do DHCP by default)

• find the IP address of the android VM, by going to the console and then typing: netcfg

• you can go back to the UI by pressing

• on you host machine, cd /out/host/linux-x86/bin/

• ./adb kill-server

• ./adb connect :5555, after this command, you should see something like below

* daemon not running. starting it now *

* daemon started successfully *

connected to :5555

• ./adb logcat to dump the debug log

2. using adb with a NAT'ed VM

• The steps above work nicely if you have a VM which is set up to use Bridged or Host-Only adapters

• However, if you have a NAT'ed VM you cannot connect to the VM IP from the host

• You will need to set up port forwarding for a host port to be forwarded to the VM port 5555 (which is adb)

• VBoxManage modifyvm

• Example from one machine:

• VBoxManage modifyvm froyo --natpf1 adb,tcp,*,5555,*,5555

• Once this is done, you should see the local port (i.e. 5555 in this case) bound on the host via netstat -a

• You can now connect to the VM by adb localhost:5555

2.a using adb with KVM (qemu)

If you are using KVM instead of Virtualbox you may find the following useful.

Example of running a iso using kvm:

kvm -soundhw es1370 -net nic -net user,hostfwd=tcp::4444-:5555 -cdrom buildname.iso

note the networking arguments: this allows "user networking" which doesn't need root access, while still allowing adb connections, by forwarding them on port 4444 of localhost, so to connect you would use:

adb connect localhost:4444

to disconnect simply (you'll need to do this after stopping/restarting a VM session):

adb disconnect

Its also possible to pass-through usb devices from the host to android guest running in kvm by adding the parameters:

-usb -usbdevice host:2.*

where in the above example that would pass through all devices on the number 2 usb host bus.

3. how to use gdb with gdbserver:

Android-x86 comes with a preinstalled gdbserver. And you can find it in /sbin/gdbserver. To use gdb to debug your process, you need to:

• set up host-only network as mentioned earlier

• in the terminal emulator, run su

• in the terminal emulator, run gdbserver

:1234 [application binary name with the path] or [--attach pid]

• on your host machine, run gdb [path of your application binary]

• gdb > target remote :1234

• gdb > set solib-search-path

• gdb > c

4. Stop zygote to run automatically:

in the vendor/asus/eeepc/init.rc, change following lines

service zygote /system/bin/app_process -Xzygote /system/bin --zygote --start-system-server

socket zygote stream 666

onrestart write /sys/android_power/request_state wake

onrestart write /sys/power/state on

to:

service zygote /system/bin/app_process -Xzygote /system/bin --zygote --start-system-server

socket zygote stream 666

onrestart write /sys/android_power/request_state wake

onrestart write /sys/power/state on

disabled

oneshot

To start zygote manually just do "start zygote" from the command line.

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/weixin_39831170/article/details/117655598

智能推荐

link和unlink讲解_gufeijunchi的专栏-程序员宅基地_link和unlink

文件处理常用方法及link和unlink讲解[cpp] /* * 函数介绍:access函数,当对文件使用时,判断是否存在指定的文件,以及是否能够按指定的模式进行访问。 * 头文件:unistd.h * 参数mode可为以下的其中之一: *   00 只存在 *   02 写权限 *   04 读权限 *   06 读和写权限 *  返回

手机 modem开发(19)---LTE注网总体流程_zhangbijun1230的专栏-程序员宅基地

LTE注网总体流程注网流程1. 开机驻留UE开机后在SIM卡初始化还未完成前,会先尝试获取限制服务。获取限制服务后可以支持拨打紧急电话2. 初始化SIM卡从AP侧可以看到SIM卡READ的状态。从modem侧,过滤NAS消息,当SIM卡初始化完成后会发出CM_SIM_AVAILABLE_CNF消息。3. 选择PLMN选择PLMN的时候会从SIM卡中读取,及配置文件中读取已有的PLMN信息,如RPL...

linux中hdfs格式化,HDFS操作命令_Min ZR的博客-程序员宅基地

总结:上传文件:put、copyFromLocal、moveFromLocal下载文件:get、copyToLocal、moveToLocal查看文件:text、cat、tail合并文件:getmerge命令详解HDFS命令基本格式:hadoop fs -cmd < args >表格:选项名称使用格式含义-ls-ls 查看指定路径的当前目录结构-lsr-lsr 递归查看指定路径的目录结...

java怎么打开_java开不了怎么办?java怎么打开?_Hasaki酱的博客-程序员宅基地

我们在打开java软件的时候,总是提示打不开,这可急坏了小伙伴,软件打不开,就无法写程序了,那么接下来,我们就来给大家讲解一下java开不了的解决方法。1、先保证正确安装了JAVA环境。2、再打开“控制面板”中的“Java”组件设置程序。3、切换到“JAVA控制面板”中的“安全”选项卡,并将“安全级别”设置到最低级。4、然后再单击对话框右下角的“编辑站点列表”按钮。5、在打开的“例外站点列表”对话...

oracle分组后合并其中一个字段 (2)_weixin_30835923的博客-程序员宅基地

1、SELECT wmsys.wm_concat(t.org) orgs, t.area_nameFROM (SELECT concat(concat(b.abbreviation, '-'), b.org_name) org,a.area_name area_nameFROM t_organization bleft join t_area_store aon a.store_code =...

ToolTip功能_weixin_30268071的博客-程序员宅基地

直接看效果图:使用普通的HTML属性alt只能简单地提示一些文本,如上这些复杂的功能就需要用JavaScript实现。详细代码如下:Code<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"...

随便推点

Hive 复杂数据类型之map_鸭梨的博客-程序员宅基地_hive map

定义格式如下:create table tableName(.......colName map<T,T>......)案例准备:测试数据如下zhangsan chinese:90,math:87,english:63,nature:76lisi chinese:60,math:30,english:78,nature:0wangwu chinese:89,math:25create table if not exists map1( name string,

java中writebytes是什么编码_Java编码的那些事儿_weixin_28911533的博客-程序员宅基地

来上海百度实习也才没多久,这是第三个礼拜吧,接手的项目相当紧迫,而且作为一个实习生我是main coder,不由地带动了极大的工作积极性。这个一开始认为很简单很明了的“小”项目,没想到让我学到了很多东西,今天就讲讲关于Java编码的那些事儿。Java编码Unicode是全球标准字符集,是Java所为String采用的编码方式,任何字符用2个字节表示。String实例中保存有一个char[]字符数组...

AlexNet,ResNet34,SqueezeNet模型的实现_aift的专栏-程序员宅基地

文章目录概要__init__.pybasic_module.py具体模型定义alexnet.pyresnet34.pysqueezenet.pyReferences概要如果对这几种基础模型不太了解,请先参考博客。首先来看程序文件的组织结构:├── checkpoints/├── data/│ ├── __init__.py│ ├── dataset.py│ └── ge...

css3 滑动验证,Vue 实现拖动滑块验证功能(只有css+js没有后台验证步骤)_weixin_42322219的博客-程序员宅基地

vue验证滑块功能,在生活中很多地方都可以见到,那么使用起来非常方便,基于vue如何实现滑块验证呢?下面通过代码给大家讲解。效果图如下所示:拖动前拖动后代码引用的css与js都是线上的将代码全部复制到一个html中可以直接打开,极其简单。来分析一下代码底色div上放了一个变色div再放一个提示字的div最后加一个滑块div给滑块div绑定鼠标移动事件.drag {border-radius:30p...

Mysql 插入记录时检查记录是否已经存在,存在则更新,不存在则插入记录SQL_dfafa30201020的博客-程序员宅基地

Mysql 插入记录时检查记录是否已经存在,存在则更新,不存在则插入记录SQL我们在开发数据库相关的逻辑过程中, 经常检查表中是否已经存在这样的一条记录, 如果存在则更新或者不做操作, 如果没有存在记录,则需要插入一条新的记录。这样的逻辑固然可以通过两条sql语句完成。SELECT COUNT(*) FROM x...

Shell脚本 awk实现查看IP连接数_沐沐.-程序员宅基地_shell 查看连接数

一.简介处理文本,是awk的强项了。 无论性能已经速度都是让人惊叹!二.使用适用:centos6、7+语言:英文注意:无cat awk_ip.shawk 'BEGIN{ while("netstat -an"|getline){ if( $5 ~ /[1-255]/) { split($5,t1,":"); tarr[t1[1]]++; } } for(k in t

推荐文章

热门文章

相关标签