Android

ph
Admin (토론 | 기여)님의 2017년 3월 30일 (목) 23:58 판 (→‎basic)
이동: 둘러보기, 검색

/etc/hosts file setting in android emulator

basic

localhost$ adb -e shell

emul$ su
emul$ mount
rootfs / rootfs ro 0 0
tmpfs /dev/tmpfs rw,mode=600 0 0
proc /proc proc rw 0 0
sysfs /sys sysfs rw 0 0
none /acct cgroup rw,cpuacct 0 0
tmpfs /mnt/asec tmps rw,mode=755,gid=1000 0 0
none /dev/cpuctl cgroup rw,cpu 0 0
/dev/block/mtdblock0 /system yaffs2 ro 0 0
/dev/block/mtdblock1 /data yaffs2 rw,nosuid,nodev 0 0
blablabla...
emul$ mount -o remount,rw -t yaffs2 /dev/block/mtdblock0  /system
emul$ cat /etc/hosts
cat /etc/hosts
127.0.0.1    localhost
emul$ echo '(target ip)' >> /etc/hosts

if an error occurs.(almost permission error)

localhost$ emulator -avd (vmname) -partition-size 1024 -memory 512

partition-size or memory size can be given differently.(maybe)