I want to push a *.mp3 file in to my emulator, but it gives me these 2 errors:
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:
2-Add these 2 lines to the 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
The thing that makes me wonderful is that the sdcard folder in file explorer has all the necessary permissions
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:
./adb shell su mount -o rw,remount rootfs / chmod 777 /mnt/sdcard
and then typed
exit to exit
exit again to exit the adb shell.
@atisman’s answer got me working. There are two small bits to add to his response though:
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:
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.
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.
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 .