Reputation: 20100
I'd like to create an Android Virtual Device against which I can test recent issues with writing to external SD cards. I would expect the external sd card to be found at location like "/storage/extSdCard/DCIM/" on the AVD's file system. Any suggestions on how I can accomplish this?
Upvotes: 4
Views: 12301
Reputation: 5057
To add removable storage to your AVD use:
~/Android/android-sdk/tools/mksdcard [memory size] [output file]
to create SD card image.
Then pass it in Advanced AVD Settings dialog: SD card -> External file
DONE :)
You can learn more about the mksdcard tool here: https://developer.android.com/studio/command-line/mksdcard
Upvotes: 7
Reputation: 4528
On macOS Mojave 1.14.3 with Android Studio 3.3.1 I found the path to be slightly different.
Create a 128 Gb sdcard:
~/Library/Android/sdk/tools/mksdcard 128G sdcard.ini
Upvotes: 0
Reputation: 11
You can open Android Device Monitor which is the Android symbol next to the SDK Manager. Once opened you can see the files using the file explorer and here you can create the required folders/path for using the external SD card.
There is a chance that when you try and create a folder it will say it is read only, if this happens open up command prompt and using adb shell input these commands:
mount -o rw,remount rootfs /
chmod 777 /mnt/sdcard
exit
These commands are from this link
Upvotes: 1