我最近安装了我的Droid X,一切似乎都很完美。我做了一些改变来构建。prop,当我做adb push build时。prop /system/我得到以下错误:未能复制'c:\build。支持“到”/system//build。prop':只读文件系统。

我该如何解决这个问题?


当前回答

我认为最安全的方法是将/system重新挂载为可读写,使用:

mount -o remount,rw /system

完成后,将其重新挂载为只读:

mount -o remount,ro /system

其他回答

This worked for me

#Mount as ReadOnly

su -c "mount -o rw,remount /system"
# Change Permission for file
su -c "chmod 777 /system/build.prop" 
#Edit the file to add the property
su -c "busybox vi /system/build.prop"
# Add now
service.adb.tcp.port=5678

# Reset old permissions
su -c "chmod 644 /system/build.prop"

# Mount as readonly again once done
su -c "mount -o ro,remount /system"

我从谷歌上找到了这篇文章,并想在Sony Xperia Z(4.2.2)上添加必要的步骤。

索尼有一个看门狗进程,当你在/和/system(这些是我唯一试图修改的)上将ro更改为rw时,它会检测到。

下面是我运行来执行我试图实现的更改的代码。我把它们粘贴到一个窗口中,因为从/sbin/ric中删除执行位需要快速完成,以阻止它自己重新启动。(我试图阻止里克;这是行不通的-尽管它可以在之前版本的android手机上运行)。

pkill -9 ric; mount -o rw,remount -t rootfs /
chmod 640 /sbin/ric
mount -o rw,remount /system

我在这里修改了hosts文件,因此可以在这里对文件系统进行所需的更改。要让事情保持原样,请这样做:

mount -o ro,remount /system
chmod 750 /sbin/ric
mount -o ro,remount -t rootfs /

这时ric会自动重启。(它自动为我重启了。)

我用模拟器检查,下面工作。

亚洲开发银行重启 adb root && adb remount && adb push ~/Desktop/hosts /system/etc/hosts

如上所述,在单镜头中执行第二步。

虽然我知道这个问题是关于真实设备的,但如果有人在模拟器中遇到类似的问题,无论2017年2月最新的工具是什么,模拟器都需要从命令行启动:

-writable-system

对于任何可写入/系统的内容。如果没有这个标志,remount或mount的任何组合都不允许写入/system。

在模拟器以该标志启动后,在adb根目录后重新安装一个adb就足以获得推送到/system的权限。

下面是我用来运行模拟器的命令行示例:

./emulator -writable-system -avd Nexus_5_API_25 -no-snapshot-load -qemu

-avd标志的值来自:

./emulator -list-avds
adb remount

对我来说,这似乎是最简单的解决方案。