Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android - SD Card - Emulator - Ubuntu

I need to add some files to an SD card on Android Emulator. I am using Intellij Idea on an Ubuntu system.

What I 've done so far is:

  1. Create SD Card image using mksdcard command -> mksdcard -l SD256M 256M ~/sdcard256m.img.
  2. Launched Android Emulator with command line option -> -sdcard ~/sdcard256m.img

However, I am unable to add files to the SD Card using DDMS - File Explorer (launched DDMS from command line).

I get the following error.

E/ddms: transfer error: Read-only file system Failed to push testfile.mp3 on emulator-5554: Read-only file system

Also, on the Emulator, under Settings > SD Card & Phone Storage Settings, I see the fllowing:

Total Space - Unavailable

Available Space - Unavailable

Mount SD Card - Insert an SD Card for mounting

Format SD Card - Format (erase) the SD Card

I am not sure if the emulator is able to pick up the SD card image that I created.

Please let me know where I am going wrong?

Thanks a lot!

like image 750
Van de Graff Avatar asked Feb 28 '26 00:02

Van de Graff


1 Answers

The problem was with the command line parameter while launching the Emulator

~/sdcard256m.img

I had to expand "~" and changed it to

/home/username/sdcard256m.img

The SD Card got detected in the Emulator & I was able to PUSH files through DDMS File Explorer.

like image 105
Van de Graff Avatar answered Mar 02 '26 16:03

Van de Graff



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!