我在模拟器中运行了android棉花糖,并执行了以下命令:
adb root
adb mount -o remount,rw /system
adb push file /system/file输出结果是
adb: error: failed to copy 'file' to '/system/file': Read-only file system奇怪的是,在重新挂载系统分区之前,系统分区被挂载为
/dev/block/vda /system ext4 ro,seclabel,relatime,data=ordered 0 0在重新挂载之后,它被挂载为
/dev/block/vda /system ext4 rw,seclabel,relatime,data=ordered 0 0它似乎是可读/可写的。在推送之后是
/dev/block/vda /system ext4 ro,seclabel,relatime,data=ordered 0 0再来一次。更奇怪的是,这个系统似乎只写过一次:
root@generic_x86:/system # mount | grep system
/dev/block/vda /system ext4 rw,seclabel,relatime,data=ordered 0 0
root@generic_x86:/system # touch foo
root@generic_x86:/system # touch foo2
touch: 'foo2': Read-only file system
root@generic_x86:/system # mount | grep system
/dev/block/vda /system ext4 ro,seclabel,relatime,data=ordered 0 0
root@generic_x86:/system # ls -la foo*
-rw-rw-rw- root root 0 2016-09-07 15:50 foo在此之后,我必须重新启动设备,因为系统分区不能再次重新挂载。
发布于 2016-10-09 21:48:06
从dmesg日志中注意到,我的模拟器使用的是@ android-studio/sdk/system-images/android-23/google_apis/x86)而不是goldfish.fstab的Ranchu.fstab。因此,在我的Android Studio (版本2.2)的SDK文件夹中,将"kernel-ranchu“文件移到了其他地方。
使用此更改,当我再次运行仿真器(擦除仿真器数据)时,系统分区保持为"rw“,而不会改回"ro”。
我尝试这样做的原因是因为在运行仿真器时,我在dmesg日志中看到了IO错误。如果不使用ranchu fstab,分区名称将从/dev/block/vda更改为/dev/block/mtd0,依此类推。
我不确定问题的根本原因是什么,但强制仿真器不选择ranchu.fstab似乎有所帮助。
发布于 2019-11-28 22:24:37
相反,您应该执行:
$ adb remount来自man adb
adb重新挂载
在设备读写上重新装载/system、/vendor (如果存在)和/oem (如果存在)分区
https://stackoverflow.com/questions/39371896
复制相似问题