3

I've built the android source code and run the emulator successfully except one thing - SD card couldn't be mounted. Here is how I tried to mount it. 1. create a sdcard.img by mksdcard tool under /out/host/linux-x86/bin/ mksdcard 256M out/target/product/generic/sdcard.img

  1. sdcard.img is rw
  2. run emulator with command line: out/host/linux-x86/bin/emulator -sysdir out/target/product/generic/ -system out/target/product/generic/system.img -ramdisk out/target/product/generic/ramdisk.img -data out/target/product/generic/userdata.img -kernel prebuilt/android-arm/kernel/kernel-qemu -skindir sdk/emulator/skins -skin WVGA800 -scale 0.7 -memory 512 -partition-size 2024 -sdcard out/target/product/generic/sdcard.img the file under /system/etc/vold.conf is ok. system log shows: <6>mmc0: new SD card at address e118 <6>mmcblk0: mmc0:e118 SU02G 256 MiB <6> mmcblk0:

But the truth is that it failed to mount sdcard. It will get a "read only" error if trying to write data in /mnt/sdcard/

Anyone can help on this? thanks in advance.

user1805192
  • 31
  • 1
  • 2

2 Answers2

0

just follow below step:

  1. Goto the Android Virtual device manager
  2. click New for create new Vitual device
  3. Add Name and choose your package
  4. Under hardware you just click New Button and then pop new Window
  5. After select SdCard support in drop down list near Property
  6. finally you have gotten emulator with SDCard support
Prabu
  • 1,441
  • 15
  • 20
0

First, emulator should work without any parameters by setting up the right environment variables as described here.

Create sd card image file sdcard.img (on linux, using dd /dev/zero to make empty file filled by zeroes suffices)

Make FAT or ext4 filesystem on it (on linux, mkdosfs path/to/sdcard.img) It should be possible to skip this step and format it from within emulator, too.

Then run

emulator -sdcard path/to/sdcard.img

In my case, it shows in Settings as "usb storage", instead of "sd card".

Community
  • 1
  • 1
Juraj
  • 860
  • 4
  • 16