需求描述
adb 传输文件的权限问题——remote couldn’t create file: Read-only file system
需要push /system/system_ext/priv-app/ 安装系统apk
adb root
adb remount
adb报错:remote couldn't create file: Read-only file system
解决
需要关闭linux kernel 安全验证功能 dm-verity
1. 关于 dm-verity
Device-Mapper’s “verity” target provides transparent integrity checking of block devices using a cryptographic digest provided by the kernel crypto API. This target is read-only.
adb --help 说明
disable-verity disable dm-verity checking on userdebug builds
enable-verity re-enable dm-verity checking on userdebug builds
2.关闭dm-verify
adb disable-verity
报错:Device is locked. Please unlock the device first using overlayfs
解决
(1) 进入开发者模式,打开OEM 解锁
(2) adb reboot bootloader
进入fastboot模式
(3) fastboot flashing unlock
, 需要在设备上面选择
unlock,成功后会提示Finished. Total time: 0.025s
(4)如果机器没有自动重启,则执行fastboot reboot
重启手机.在运行过程中我的机器会自动重启所以省略了这一步
(5)开机之后,依次adb root,adb disable-verity,adb reboot
即可,此时查看OEM 解锁项是灰显的
adb disable-verity 提示
第一种提示: 说明没有打开OEM解锁
Device is locked. Please unlock the device first
using overlayfs
Now reboot your device for settings to take effect
第二种提示: 说明成功
using overlayfs
Successfully disabled verity
Now reboot your device for settings to take effect
注意:在fastboot reboot
后机器可能停止在logo加载过程中… ,此时可以直接adb 操作
第三种提示:adb remount
后提示,说明OEM adb disable-verity
没成功
C:>adb root
C:>adb remount
Skipping /system for remount
Skipping /vendor for remount
Skipping /product for remount
No partitions to remount
remount failed
3. push 安装apk不生效
(1) adb shell 找到 apk 位置删除apk
(2) adb push 到上面删除位置
注:
直接push覆盖更新的代码不生效,需要手动删除
原因参考:https://blog.youkuaiyun.com/cengdong/article/details/71105059
(3)kill app生效
adb shell am force-stop com.android.gallery3d
adb shell am start -n com.android.gallery3d/com.android.gallery3d.app.GalleryActivity