您的位置:首页 > 移动开发 > Android开发

修改Android hosts文件

2012-10-18 09:25 302 查看
1、启动模拟器,配置参数,设置内存大小, -partition-size 256



2、启动adb shell

>adb shell

排除Android Read-only file system 错误

#mount -o remount rw /

设置目录可读写权限

#mount -o remount,rw rootfs /system/

转向hosts所有目录

#cd /system/etc

修改hosts文件

#rm hosts

#echo "127.0.0.1 localhost" > hosts

#echo "10.249.50.47 account.aliyun.com" >> hosts

3、

Mount a filesystem read-write

Very often when you want to write files to a particular partition on ADP1, you will get a "Permission Denied" if the partition is mounted read-only.

To get around this, you need to mount the partition read-write. Typically this is done with /system partition

$ adb shell

$ su

$ mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system

(Replace /dev/block/mtdblock3 &
/system with appropriate device path and mount point, as obtained from
cat /proc/mounts)

参考:/article/6580178.html
http://android-tricks.blogspot.com/2009/01/mount-filesystem-read-write.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: