android - 如何将文件复制到 Android 的 /system 文件夹
问题描述
我正在运行 Android 模拟器(模拟器版本 30.5.5.0)和Pixel_3a_API_30_x86
来自 AndroidStudio的 avd:。使用adb.exe
(Android Debug Bridge)我尝试将文件从 Windows 主机复制到模拟的 Android文件夹,但在尝试了类似本教程/system/...
的不同操作后我无法做到:
- 我从命令行运行 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
?
解决方案
链接中的教程缺少一些命令,并且网页未使用来自 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
推荐阅读
- ckeditor - 在 RTE 编辑器中停用自动链接 - Typo3
- python - 如何使用列表推导对开始到结束范围内的数字进行平方?
- c# - 如何选择一个值来填充密封类中的两个值
- c# - 单元测试在 using 语句中返回的流(因此关闭)
- angular - 如何在ngrx / store测试中为特定选择器返回假/存根值?
- python - 覆盆子 pi pip install psychopy HDF5 not found
- swift - UICollectionViewCell cellforItemAt:带数组
- java - 数独游戏的标记数字
- wpf - 单击 UserControl 中的 Button 以将值设置为 MainWindow 的 columndefinition
- angular - 带有锚标记(划分)刷新的角度 URL 转到主页