1

Trying to push files to sd card via eclipse.

When I pull up my DDMS view, I have 3 main directories on the device:

/data
/mnt
/system

The only SDcard folder is located at /mnt/sdcard and it has permissions d--------.

I can't push anything to it, with the error:

Failed to push selection: Read-only file system

I had deleted and remade the device many times, with many different SD Card sized. I've tried adb remount at the adb shell as well as chmod 777 on the folder.

Why is this so difficult? Please help if you can.


rootfs / rootfs ro 0 0 tmpfs /dev tmpfs rw,nosuid,mode=755 0 0 
devpts /dev/pts devpts rw,mode=600 0 0 proc /proc proc rw 0 0 
sysfs /sys sysfs rw 0 0 none /acct cgroup rw,cpuacct 0 0 
tmpfs /mnt/asec tmpfs rw,mode=755,gid=1000 0 0 
tmpfs /mnt/obb tmpfs rw,mode=755,gid=1000 0 0 
none /dev/cpuctl cgroup rw,cpu 0 0
/dev/block/mtdblock0 /system yaffs2 ro 0 0 
/dev/block/mtdblock1 /data yaffs2 rw,nosuid,nodev 0 0
/dev/block/mtdblock2 /cache yaffs2 rw,nosuid,nodev 0 0 
inazaruk
  • 74,247
  • 24
  • 188
  • 156
RedLeader
  • 657
  • 1
  • 15
  • 28
  • Run "adb shell mount" from console/terminal and post the result here. – inazaruk Jun 20 '11 at 18:10
  • I meant to add this output to your question. It looks like you sdcard was never mounted. – inazaruk Jun 20 '11 at 18:16
  • Humor me for a moment, what is the size of your SD card? Via Window -> Android SDK and AVD manager -> select the device you're using -> under SD card size. – Otra Jun 20 '11 at 18:28
  • Currently 4GB. I usually use 16GB but thats one of the things I've been changing and praying fixes it. – RedLeader Jun 20 '11 at 18:31
  • You should turn off your emulator, clear LogCat and then start you emulator and carefully look at your logs. It might say something about sdcard there. – inazaruk Jun 20 '11 at 18:35
  • Did it again. Got one: D-28-Void-Volumn sdcard state changing -1 (Initializing) -> 0 (No-Media). But I did specify it in the dialog box when I created the device... – RedLeader Jun 20 '11 at 18:51
  • I having same problem.. wierd.. – Ahmed Nov 02 '12 at 17:42

7 Answers7

1

I had the same problem, and it seems that it's impossible to mount sdcard on emulator using API Level 10. I don't know if it's an android-sdk problem or Eclipse problem, but that's it. It's possible to mount sdcard on emulators with API 7(2.1), 8(2.2) and 15(4.0.3). By the way, mounting sdcard on API 7,8,15 is a bit buggy too. I had to launch each emulator 3 times before I managed to mount sdcard: 1st and 2nd launch - not mounted, 3rd launch - mounted!

kord
  • 482
  • 3
  • 12
0

If you are using eclipse Window > AVD Manager > [Select your device] > Edit

SD Card: Enter some value Eg:512 MiB

Should work

Ravi
  • 487
  • 5
  • 6
0

In the above post the list of mounts have been shown, in which no mount to sdcard is there. In the DDMS the list of permissions for sdcard is shown as d-------- Anyways, the problem for me was solved once I deleted the emulator and created new one.

Michael Petrotta
  • 59,888
  • 27
  • 145
  • 179
Chaitanya
  • 3,399
  • 6
  • 29
  • 47
0

I hope you know this and done this too.... you will need to give your app the correct permission to write to the SD Card by adding the line below to your Manifest:

uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" 
Druid
  • 6,423
  • 4
  • 41
  • 56
grv_9098
  • 465
  • 5
  • 16
0

make sure that you pushing the file to your emulator from the left menu (devices) list in DDMB and not to your actually physical device.

0

I had the exact same problem and did 2 things that solved it (I don't know exactly which one did it!):

1) In DDMS view, click on the little arrow on the top right of the devices window and click reset adb :

enter image description here

2) Do the instructions provided by the accepted answer to this question:

Problem Pushing Large File to Emulator/SDcard with Eclipse DDMS


I highly suspect the second one did it. But I'm not sure.

Hope it helps.

Community
  • 1
  • 1
Mahm00d
  • 3,881
  • 8
  • 44
  • 83
0

Your device is most likely in "USB Mass Storage" mode and will not let you access the SDCard file system from Eclipse or adb. To fix this, set the USB mode to "Charge Only" or, in some cases, "PC Mode" might work. Depending on your device, you can usually configure this mode by dragging down the notification bar at the top of the screen and clicking on "USB Connection".

PPerez
  • 21