Emulator(2)Choose and Configure AVD and Access Real Device

1. How to identify the AVD
>mvn clean package -Dandroid.device=KIKO android:deploy android:run

Or in the pom.xml file:
…snip..
<android.device>SUPERMAN</android.device>
…snip...

Start the AVD in command line
>emulator -avd KIKO &

Start the AVD without window
>emulator -avd KIKO -no-window &

Watch the process of emulator
>ps -ef | grep emulator

2. How to access the real device
>adb shell
>su
su: permission denied

Try the software GingerBreak, not working.
http://www.addictivetips.com/mobile/how-to-root-android-2-3-gingerbread-using-gingerbreak/

install the apk package
>adb install *.apk

Try the software Universal Androot, not working
http://www.addictivetips.com/mobile/how-to-root-android-devices-with-universal-androot-app/

Try z4root
http://android.sc/download-z4root-apk-v1-3-0/

The file is z4root.1.3.0.apk
>adb install z4root.1.3.0.apk

Temporary Root seems to be work.

>adb shell
>su

It works. But even I use DDMS or ADB shell to execute the command
>su chmod 777 /system/etc/hosts
>su chmod 777 /system
Unable to chmod /system: Read-only file system

It does not work.

So I run the command like this
adb>mount

Here are the information:
rootfs / rootfs ro,relatime 0 0
tmpfs /dev tmpfs rw,relatime,mode=755 0 0
devpts /dev/pts devpts rw,relatime,mode=600 0 0
proc /proc proc rw,relatime 0 0
sysfs /sys sysfs rw,relatime 0 0
none /acct cgroup rw,relatime,cpuacct 0 0
tmpfs /mnt/asec tmpfs rw,relatime,mode=755,gid=1000 0 0
none /dev/cpuctl cgroup rw,relatime,cpu 0 0
/dev/block/mtdblock3 /system yaffs2 ro,relatime 0 0
/dev/block/mtdblock5 /data yaffs2 rw,nosuid,nodev,relatime 0 0
/dev/block/mtdblock4 /cache yaffs2 rw,nosuid,nodev,relatime 0 0
tmpfs /app-cache tmpfs rw,relatime,size=8192k 0 0
/dev/block/vold/179:1 /mnt/sdcard vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
/dev/block/vold/179:1 /mnt/secure/asec vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
tmpfs /mnt/sdcard/.android_secure tmpfs ro,relatime,size=0k,mode=000 0 0
/dev/loop9 /system/bin ext2 rw,relatime,errors=continue 0 0

So I need to make the line /system rw, not ro.
/dev/block/mtdblock3 /system yaffs2 ro,relatime 0 0

adb>mount -o rw,remount -t yaffs2 /dev/block/mtdblock3
It seems that the mount command is not right. The right command is as follow:
>mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
>chmod 777 /system
>chmod 777 /system/etc
>chmod 777 /system/etc/hosts
>adb push /Users/carl/data/hosts /system/etc/hosts

It works at last.

References:
https://groups.google.com/forum/?fromgroups=#!topic/android-developers/fsctB2VY2N0

http://www.howtogeek.com/115297/how-to-root-your-android-why-you-might-want-to/
http://www.makeuseof.com/tag/root-android-phone-superoneclick-2/
http://www.addictivetips.com/mobile/how-to-root-your-android-phone-device/

更多相关文章

  1. 代码中设置drawableleft
  2. android 3.0 隐藏 系统标题栏
  3. Android开发中activity切换动画的实现
  4. Android(安卓)学习 笔记_05. 文件下载
  5. Android中直播视频技术探究之—摄像头Camera视频源数据采集解析
  6. 技术博客汇总
  7. android 2.3 wifi (一)
  8. AndRoid Notification的清空和修改
  9. Android中的Chronometer

随机推荐

  1. Android抓取CSDN首页极客头条内容--网页
  2. android 多通知 参数问题, PendingIntent:
  3. 使用android传感器自己编写温度计,湿度计
  4. Android(安卓)studio git环境配置及提交
  5. 【Android(安卓)C#开发】Xamarin环境搭建
  6. 越过用户授权使用浮窗
  7. android 唯一识别码笔记
  8. android私有文件夹的访问
  9. Activity和Fragment之间的数据通信
  10. Android中两种设置全屏或者无标题的方法