eclipse Android:传输错误:只读文件系统

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/16752628/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 20:36:38  来源:igfitidea点击:

Android:transfer error: Read-only file system

androideclipsemobileandroid-sdcard

提问by Salman Lashkarara

I want to push a *.mp3 file in to my emulator, but it gives me these 2 errors:

我想将 *.mp3 文件推送到我的模拟器中,但它给了我以下 2 个错误:

 transfer error: Read-only file system
 Failed to push selection: Read-only file system

To resolve the problem, i have done these works, but still not working:

为了解决这个问题,我已经完成了这些工作,但仍然无法正常工作:

1-Using CMD to do this: c:\android-sdk\platform-tools\>abd remount

1-使用 CMD 执行此操作: c:\android-sdk\platform-tools\>abd remount

2-Add these 2 lines to the AndroidManifest.xml

2-将这两行添加到AndroidManifest.xml

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>

3-Set the SDcard in emulator configuration as 1024 Mb enter image description here

3-将模拟器配置中的 SD 卡设置为 1024 Mb 在此处输入图片说明

The thing that makes me wonderful is that the sdcard folder in file explorer has all the necessary permissionsenter image description here

让我感到美妙的是文件资源管理器中的 sdcard 文件夹具有所有必要的权限在此处输入图片说明

回答by atisman

Here is a solution I found in other site, which is the only way that worked in my case:

这是我在其他网站上找到的解决方案,这是在我的案例中唯一有效的方法:



In a terminal (I work on Mac OS X) I wnt to sdk/platform-tools directory (to get access to the adb shell) then I typed the following commands:

在终端(我在 Mac OS X 上工作)中,我进入 sdk/platform-tools 目录(以访问 adb shell),然后输入以下命令:

./adb shell
su
mount -o rw,remount rootfs / 
chmod 777 /mnt/sdcard 

and then typed exitto exit su, and exitagain to exit the adb shell.

然后输入exitexit su,然后exit再次退出 adb shell。

回答by Watercayman

@atisman's answer got me working. There are two small bits to add to his response though:

@atisman 的回答让我开始工作。不过,他的回答有两点要补充:

First, picky as it seems, you might need an extra '-' in the unix command line, depending on your local OS. The only way it would work for me was:

首先,虽然看起来很挑剔,但您可能需要在 unix 命令行中添加一个额外的“-”,具体取决于您的本地操作系统。它对我有用的唯一方法是:

mount -o -rw,remount rootfs / 

The other item is to make sure you have actually defined the device's SD card with some size. I see you have, but I didn't, so just putting it out there in case anyone else has a similar issue.

另一项是确保您实际定义了具有某种大小的设备的 SD 卡。我看到你有,但我没有,所以把它放在那里以防其他人有类似的问题。

Open AVD manager, click on the device you are using... click 'edit' and go to the "SD Card" area. Make sure if "Size" is clicked, that there is a number in the area next to it. Otherwise the SD card can't hold any info.

打开 AVD 管理器,单击您正在使用的设备...单击“编辑”并转到“SD 卡”区域。确保如果单击“大小”,它旁边的区域中有一个数字。否则 SD 卡将无法保存任何信息。

回答by afra mehrparvar

if some one have same problem in new build of studio . 0.8.9 and above see my solution and it will work like a charm , here : afra mehrparvar solution in the bottom of the page .

如果有人在新建的工作室中遇到同样的问题。0.8.9 及更高版本请参阅我的解决方案,它会像魅力一样工作,在这里:页面底部的 afra mehrparvar 解决方案。

Android Emulator sdcard push error: Read-only file system

Android Emulator sdcard推送错误:只读文件系统