adb remount 在 android api 29 上坏了吗?

Is adb remount broken on android api 29?

当来自模拟器的 运行 时,

adb remount 在 api 29 上无法正常工作。该命令在已尝试的所有其他模拟器(18、23、25、26、27 和 28)上运行良好。

知道为什么会这样吗?

Skip mounting partition: /product_services
Skip mounting partition: /product
Skip mounting partition: /product_services
Skip mounting partition: /product
Skip mounting partition: /product_services
Skip mounting partition: /product
Skip mounting partition: /product_services
Skip mounting partition: /product
Skip mounting partition: /product_services
Skip mounting partition: /product
Skip mounting partition: /product_services
W Disabling verity for /system
E Skipping /system
Skip mounting partition: /product
Skip mounting partition: /product_services
Skip mounting partition: /product
Skip mounting partition: /product_services
Skip mounting partition: /product
Skip mounting partition: /product_services
Skip mounting partition: /product
Skip mounting partition: /product_services
Skip mounting partition: /product
Skip mounting partition: /product_services
Skip mounting partition: /product
Skip mounting partition: /product_services
Skip mounting partition: /product
Skip mounting partition: /product_services
Skip mounting partition: /product
Skip mounting partition: /product_services
Skip mounting partition: /product
Skip mounting partition: /product_services
Skip mounting partition: /product
Skip mounting partition: /product_services
Skip mounting partition: /product
Skip mounting partition: /product_services
/system/bin/remount exited with status 7
remount failed

更新:

请参阅@KiddTang 的回答,这似乎是一个实际的解决方案


  • 即使使用 API 30 (API R),这个问题现在仍然存在!甚至在使用可写系统选项启动模拟器时:(emulator -writable-system -avd NAME_OF_DEVICE)!

  • 我尝试按照这些 instructions 来禁用-verity并在重新安装之前重新启动

    • 然而,此解决方案导致我的模拟器 freeze/hang,并且无法启动。

注意:我在将模拟器与“Android Sdk Images”提供的“AVD”一起使用时遇到了当前问题。然而,这种图像可能在某种程度上受到限制。因此,其他类型的 Android 图片

可能不会出现这种情况

来自 Link 的代码摘要:

  • 此代码不适用于我的情况,因为它会导致模拟器冻结并且在重新启动后无法启动,但是,它们可能适用于其他情况。
    • 有关其他详细信息和注意事项,请参阅 link
  • 使用以下顺序执行重新挂载。
$ adb root
$ adb disable-verity
$ adb reboot
$ adb wait-for-device
$ adb root
$ adb remount
  • 然后输入以下序列之一:
$ adb shell stop
$ adb sync
$ adb shell start
$ adb reboot
$ adb push <source> <destination>
$ adb reboot
  • 请注意,您可以将上述顺序中的这两行替换为:
$ adb disable-verity
$ adb reboot
  • 这一行:
$ adb remount -R

注意:如果设备已经处于adb remount状态,adb remount -R不会重启。

我用 emulator -avd Pixel_3a_XL_API_29 -writable-system -no-snapshot-load

我发现很多人遇到模拟器死机并且无法启动 android 如果你尝试

$ adb root
$ adb disable-verity
$ adb reboot   <--- By now emulator is freezed

那你可以试试这个

$ adb root
$ adb shell avbctl disable-verification  <--- this will not freeze the emulator
$ adb reboot

模拟器重启时 尝试重新挂载不会有问题

adb root
adb remount 

adb push 将能够写入 system 目录