问题
I just want to know how to wipe the virtual sdcard in the android emulator.
回答1:
Delete the sdcard form the AVD manager and add a new one!?
回答2:
With the expected caveats and warnings about using commands in the "rm -r *" family, you can also use: adb -e shell rm -r /mnt/sdcard/*
回答3:
You can do it easily from Android Settings app: "Storage"->"Erase SD card".
回答4:
You could try deleting this file: sdcard.img in the emulator directory. That's where it stores the info.
Just rename at first it in case it crashes things. I haven't tested this before.
回答5:
When you launch the emulator there's a checkbox to wipe user data.
回答6:
Store your android avd data into a separate dir and just delete the dir and recreate the avd:
rm -rf $TMPDIR
install -d $TMPDIR
$android create avd --force --target "$target" --name $avdname \
--sdcard 32M --skin WVGA800 --path $TMPDIR
emulator -avd $avdname -wipe-data -qemu -enable-kvm ...
That way, you make sure that you always start from an at least somewhat consistent state.
来源:https://stackoverflow.com/questions/5628393/how-to-format-wipe-emulators-sdcard-mnt-sdcard