修改Android hosts文件

来源:互联网 发布:c语言教学视频百度网盘 编辑:程序博客网 时间:2024/04/29 05:20

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 fromcat /proc/mounts)


参考:http://www.cnblogs.com/chenjunbiao/archive/2012/03/16/2400026.html

           http://android-tricks.blogspot.com/2009/01/mount-filesystem-read-write.html


原创粉丝点击