如何使模拟器中的AVD中的系统分区可写 [英] How to make system partition in AVD in emulator writable

查看:149
本文介绍了如何使模拟器中的AVD中的系统分区可写的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个非常老的问题,但是令我惊讶的是,没有一种解决方案对我有用.我需要在为Android 7.0版创建的AVD(在模拟器中)中将android应用程序作为系统应用程序运行.为此,我想将apk文件推送到系统分区,但是我不断收到错误消息,说它是只读文件系统.我在stackoverflow上发现了许多类似的问题,但对我来说没有任何作用.我以root身份重新启动了adb,并按照对类似问题的回答中的建议使用remount来执行它,但是系统分区文件系统权限没有更改.这是一个示例会话:

This is fairly a very old question but I am surprised that none of the solutions are working for me. I need to run an android app as system app in an AVD (in emulator) created for Android version 7.0. For this, I want to push apk file to system partition but I keep getting error saying it is read only file system. I found many similar questions on stackoverflow but nothing is working for me. I restarted adb in root, executed it with remount as suggested in answers to similar questions, but system partition file system permissions do not change. Here is a sample session:

mvsagar@mvslt:~/sw/android_sdk/platform-tools$ ./adb root
restarting adbd as root
mvsagar@mvslt:~/sw/android_sdk/platform-tools$ ./adb remount
remount succeeded
mvsagar@mvslt:~/sw/android_sdk/platform-tools$ ./adb push /home/mvsagar/projects/AndroidStudioProjects/LcnApps/app/LCNUE.apk  /system/app/LCNUE.apk
adb: error: failed to copy '/home/mvsagar/projects/AndroidStudioProjects/LcnApps/app/LCNUE.apk' to '/system/app/LCNUE.apk': couldn't create file: Read-only file system

我尝试使用adb shell使用读/写(rw)选项手动重新安装,但是重新安装失败.

I have tried manually remounting with read/write(rw) options using adb shell, but the remounting fails.

是否可以对系统分区具有读/写权限?

Is there any way to have read/write permission on system partition?

我的开发环境是Ubuntu上的Android Studio.

My dev env is Android Studio on Ubuntu.

推荐答案

在我的情况下,我使用avd(基于:Android 8.0(Oreo)标签/ABI:google_apis/x86_64).

In my case, I use a avd( Based on: Android 8.0 (Oreo) Tag/ABI: google_apis/x86_64 ).

$ emulator -avd Nexus_5X_API_26_APIs -writable-system 
$ adb root 
$ adb remount

然后,/system是可写的.

$ adb push somefile /system/bin/是工作.

这篇关于如何使模拟器中的AVD中的系统分区可写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆