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 开发者_StackOverflowemulator to react as if there is no sdcard connected. How to perform this?
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"
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
精彩评论