How to format/wipe emulator's SDCARD(/mnt/sdcard)

眉间皱痕 提交于 2019-12-19 04:08:15

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!