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

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/

猜你喜欢

转载自sillycat.iteye.com/blog/1844837