Gaurav Vichare
Gaurav Vichare

Reputation: 1183

How to add sd card to android emulator in android studio 1.5.1?

I am using android studio 1.5.1 and ubuntu 14.04. I want to add sd card to mobile device emulator.

I created new virtual device using Android Virtual Device Manager from android studio menus Tools --> Android --> AVD Manager. But there is no option to add sd card to virtual device. So tried command line tool mksdcard to create sd card as per instructions given in developer.android.com.

./mksdcard -l mySdCard 128M mySdCardFile.img

And then used following command to start emulator and load sd card.

./emulator -avd Nexus_5_API_23_x86 -sdcard mySdCardFile.img

But it gave me warning emulator: WARNING: Emulated hardware doesn't support SD Cards. -sdcard option ignored.

How can I use sd card in emulator? Please help!

Upvotes: 4

Views: 2738

Answers (2)

Artur Hellmann
Artur Hellmann

Reputation: 325

Go to your avd location (typically at ~/.android/avd/your-android-avd-id)

There is a file named config.ini

Open that and look for the line hw.sdCard=no and change it to hw.sdCard=yes.

Should work now. If you open the settings for this avd in the avd manager, you will have to set this setting in config.ini again.

Upvotes: 2

tyolab
tyolab

Reputation: 396

In your Android emulator's avd files folder (normally it is named as same as the name of the emulator plus ".avd" at the end, and it should be "Nexus_5_API_23_x86.avd" in your case) inside "~/.android/avd" directory.

Find the file named "hardware-qemu.ini", and make sure there is a line set to "hw.sdCard = true".

Upvotes: 0

Related Questions