Mazz
Mazz

Reputation: 257

AVD SD Card - External File

Im using the latest version of Android Studio and it won't allow me to add and external SD Card made with "mksdcard". In previous versions this was possible but now it just reverts to blank every time I try to add a new SD card.

Anyone face this problem or know how to fix?

enter image description here

Upvotes: 6

Views: 2013

Answers (3)

peter.petrov
peter.petrov

Reputation: 39477

I was facing the same problem today and found your question here on SO.
I was able to solve this issue by finding the config.ini file of the AVD itself,
and by editing it manually (e.g. with Notepad). On my Windows 10 machine the file is this one.

C:\Users\peter\.android\avd\Nexus_5_API_25.avd\config.ini

In that file I had to manually edit the value of this property as follows.

sdcard.path=C:\Programs\Android\SD_Card_Image\SD_Card001.img

That seems to make Android Studio to not revert back to a blank external file name.

EDIT: The weird thing is that even you specify an external file for your SD card image (as opposed to a studio managed SD card), that doesn't mean the AVD is using this exact file which you specified. Seems it uses it just initially (for initialization). Then Android Studio creates a copy of the image file somewhere (inside the AVD folder it seems) and from there on it uses his own copy. That was quite a surprising behavior to me. I even find it buggy. If that's what's intended, then what is the purpose of having the option to specify an external file?

Upvotes: 1

Vector
Vector

Reputation: 3235

One of the issues that the Android forgot to mention is with Android Studio 3.0 when you create AVD you need to now create an image for the SD CARD with the mksdcard tool to create a FAT32 disk image. After you use this tool then when you are creating the AVD you will see under advanced view the SD CARD area the External files click that and navigate to where you stored the sdCard.img file you created with mksdcard tool. Here is a bonus trick USE WITH CAUTION you can tell that emulator that it has the SD CARD ejected by changing this value hw.sdCard=yes in its config.ini file from yes to no. How to find the config.ini file

Windows Explore find the android/avd/device name open the device name file then with a FILE EDITOR like Sublime Text make the change to hw.sdCard=no and do a SAVE AS I suggest you not use MS notepad to do this

Upvotes: 1

Iker Hoëk
Iker Hoëk

Reputation: 242

That page does the same to me for "Device Frame" checkbox. It's always unchecked even though it does apply the skin.

So check first whether you can access the SD as you're supposed to.

Upvotes: 0

Related Questions