【问题标题】:How to copy a file to Android's /system folder如何将文件复制到 Android 的 /system 文件夹
【发布时间】:2021-05-07 17:06:24
【问题描述】:

我正在运行 Android 模拟器(模拟器版本 30.5.5.0)和来自 AndroidStudio 的 avd:Pixel_3a_API_30_x86。 使用adb.exe(Android Debug Bridge)我尝试将文件从 Windows 主机复制到模拟的 Android /system/... 文件夹,但在尝试了 this tutorial 等不同的东西后我无法做到:

  • 我从命令行运行android模拟器指定参数-writable-system
cd C:\Users\%username%\AppData\Local\Android\Sdk\emulator
emulator -avd Pixel_3a_API_30_x86 -writable-system

然后在模拟器运行时从另一个命令行窗口:

cd C:\Users\%username%\AppData\Local\Android\Sdk\platform-tools

adb root
adb shell "mount -o rw,remount /"
'/dev/block/dm-0' is read-only

adb push MyFile.txt /system/etc/security/cacerts

然后我得到错误: 错误:

MyFile.txt: 1 file pushed, 0 skipped. 0.1 MB/s (950 bytes in 0.011s)
adb: error: failed to copy 'MyFile.txt' to '/system/etc/security/cacerts/MyFile.txt': remote couldn't create file: Read-only file system

如何将文件从 Windows 复制到 Android /system

【问题讨论】:

    标签: android android-emulator adb


    【解决方案1】:

    链接中的教程缺少一些命令,the web page 没有更新为latest version from GitHub

    这是最终序列(API LEVEL > 28):

    adb root
    adb shell avbctl disable-verification
    adb reboot
    adb root
    adb remount
    
    adb push MyFile.txt /system/etc/security/cacerts
    

    【讨论】:

      【解决方案2】:

      首先运行adb root && adb remount

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2011-08-07
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2017-12-08
        • 2014-10-23
        • 1970-01-01
        • 2014-03-04
        相关资源
        最近更新 更多