【问题标题】:Cannot push to android emulator because of Read only file system由于只读文件系统,无法推送到 android 模拟器
【发布时间】:2018-08-31 17:51:35
【问题描述】:

我正在尝试将主机文件推送到我的 adb 设备。

所以,我做到了:

[~/Library/Android/sdk/tools]$ emulator -avd Nexus_5X_API_26_x86 -writable-system 
emulator: WARNING: System image is writable
emulator: ### WARNING: /etc/localtime does not point to /usr . 
/share/zoneinfo/, can't determine zoneinfo timezone name
emulator: ### WARNING: /etc/localtime does not point to 
/usr/share/zoneinfo/, can't determine zoneinfo timezone name

现在我在不同的控制台中 adb push hosts /system/etc/hosts

但我得到以下错误:

adb:错误:无法将“主机”复制到“/system/etc/hosts”:远程无法创建文件:只读文件系统 主机:已推送 0 个文件。 0.1 MB/s(0.001 秒内 93 个字节)

有什么建议吗?

【问题讨论】:

    标签: android macos


    【解决方案1】:

    对于 2020 年来到这里的人:

    在我的情况下,答案中的步骤不起作用,因为版本 30 API 不支持可写系统。

    我必须使用版本28 API 版本。

    【讨论】:

    • 谢谢!一开始就阻止我尝试
    【解决方案2】:

    试试这个:

    $emulator -avd Nexus_5X_API_26_x86 -writable-system 
    $adb root
    $adb remount
    $adb push hosts /system/etc/hosts
    

    【讨论】:

    • @CaoMindVu 不错!为我工作。除了remount 步骤,我什么都做;我一添加,沃拉!
    【解决方案3】:

    可能是缺少目录!

    确保您正在推送到一个存在的目录。当我尝试将照片推送到我的模拟器上的图片文件夹时,我犯了一个错误并在开始时添加了一个~:它应该是adb push -s emulator-5554 harold /sdcard/Pictures。我经常先浏览系统,adb shell

    2020 年,

    API 级别 30 没有改变任何东西,Ropstahs 现有的答案是错误的,因为我一直看到它适用于 API 级别 30 设备,有和没有 Play 商店(见截图,名为 @987654326 @):

    Ropstah:版本 30 API 不支持可写系统。

    【讨论】:

    • 对我来说,Ropstahs 的回答是正确的。我尝试使用 API 30 和 29 - 出现错误“adb:错误:无法将 'hosts' 复制到 '/system/etc/hosts':远程无法创建文件:只读文件系统”。但是,有 28 个使用相同的推送命令。
    【解决方案4】:

    我发现我需要额外的步骤来禁用验证。让它在最高 android 32(当前)的模拟器上工作

    emulator -writable-system -- @emulator_name
    
    adb root
    adb shell avbctl disable-verification 
    adb reboot
    adb remount
    adb push ./local.file /remote-location
    

    【讨论】:

      猜你喜欢
      • 2018-05-28
      • 1970-01-01
      • 2013-01-07
      • 2019-05-21
      • 1970-01-01
      • 2012-06-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多