I need to test a scenario where the sdcard (or atleast a particular directory) is read-only. Does anyone know how I can do this on the emulator?
Basically I want to mount the sdcard as read-only. I tried the following command in adb shell, but it doesn’t work.
mount -o remount r /sdcar
Here is how I managed to remount sdcard in read-only mode:
Step 1.
Execute
mountand see the list of mounted directories. Note the one with/sdcardor/mnt/sdcardin it.On my Android 1.6 emulator:
Step 2.
Execute next command:
Where
<block>and<sdcard>are first two items taken frommountoutput line with sdcard.In my case the command would be: