Android Emulator sdcard push error: Read-only file

2019-01-02 20:15发布

I am developing under Android 1.6 (Android SDK 2.1). I create a avd by using avd manager in Eclipse. When I launch this avd, I found that the /sdcard directory's permisson is "d---------". So I can't push file to the sdcard.

Does anyone know how to solve this problem?

20条回答
忆尘夕之涩
2楼-- · 2019-01-02 20:34

I think the problem here is that you forgot to set SD card size

Follow these steps to make it work:

  1. step1: close running emulator
  2. step2: open Android Virtual Device Manager(eclipse menu bar)
  3. step3: choose your emulator -> Edit -> then set SD card size

This works well in my emulator!

查看更多
泛滥B
3楼-- · 2019-01-02 20:34

I increased the virtual memory of sdcard up to 512 MB for the emulator and that was enough

查看更多
与风俱净
4楼-- · 2019-01-02 20:41

make sure that you have the correct permissions.

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> 
查看更多
时光乱了年华
5楼-- · 2019-01-02 20:43

In adb version 1.0.32 and Eclipse Luna (v 4.4.1).

I found a directory in the avd /mnt/media_rw/sdcard that you can write to using the adb command. adb push {source} /mnt/media_rw/sdcard

There appears to be rw access to this directory.

Hope this helps :-)

查看更多
冷夜・残月
6楼-- · 2019-01-02 20:43

Alternate way: Dismount the drive (from settings/storage) and re-mount the sdcard also fixes the problem. (verify by moving a file from internal storage to sdcard) In any case, this simple method saved my butt this time :)

查看更多
梦寄多情
7楼-- · 2019-01-02 20:45

Ensure two things in the AVD manager utility for the emulator:

  1. SD Card size is mentioned e.g. 512.

  2. From the Hardware tag, press New and select "SD Card Support" from the drop down menu.

Now, start the emulator. SD Card shall now support writing as well.

查看更多
登录 后发表回答