mobile 更改hosts

 

在Android下,/etc是link到/system/etc的,咱们须要修改/system/etc/hosts来实现。可是这个文件是只读,不能经过shell直接修改。能够经过链接到PC上使用adb来修改。shell

一、得到root权限:adb rootpost

二、设置/system为可读写:adb remountblog

三、将hosts文件复制到PC:adb pull /system/etc/hosts hostsrem

四、修改PC机上文件class

五、将PC机上文件复制到手机:adb push hosts /system/etc/hosts终端

至此,对hosts的修改就成功了。无需重启哦~!~权限

若是要查看是否修改为功,能够在PC上执行adb shell,运行cat /system/etc/hosts;或者在手机的终端模拟器上运行cat /system/etc/hosts。hosts

相关文章
相关标签/搜索