I just want to know whether is it possible to disable sdcard in my emulator. I don't want to delete my sdcard image file, but I want my emulator to react as if there is no sdcard connected. How to perform this?
2 Answers
1)
You can rename the file sdcard.img to whatever.img and restart emulator
2)
You can unmount sdcard within emulator in Settings
3)
You can point emulator to non-existing file with sdcard image
( http://developer.android.com/guide/developing/tools/emulator.html > Disk Images > -sdcard switch)
4)
You can't unmount SD Card from running emulator
(accroding to best answer on this: (re)mounting the SD card on android emulator)
5)
In Hardware edit details of Virtual Device (AVD) you can setup "SD Card Support" switch to "no"

- 1
- 1

- 39,650
- 37
- 158
- 244
-
second option is not available since ICS – k4dima Jan 07 '14 at 13:57
If you created the AVD image with recommended settings then the No SDCard radio button in the AVD Configuration dialog will be disabled.
You can still disable the sdcard by editing the config.ini
file for the given AVD.
For mac/linux open the config file at ~/.android/avd/Nexus_5_API_31.avd/config.ini
(where Nexus_5_API_31
is the name of the AVD you have), and search and set the following property:
hw.sdCard = no

- 28,968
- 18
- 162
- 169
-
How to find config file -> Go to Device Manager > click on `Down arrow` > `Show on Disk` and in Explorer you can see `config.ini` file. Just click on it and scroll down then you see `hw.sdCard = yes` and make them `hw.sdCard = no` – M DEV Jun 03 '22 at 17:41