androniennn
androniennn

Reputation: 3137

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

I just want to know how to wipe the virtual sdcard in the android emulator.

Upvotes: 3

Views: 14596

Answers (6)

user1050755
user1050755

Reputation: 11691

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.

Upvotes: 0

joshas
joshas

Reputation: 1474

You can do it easily from Android Settings app: "Storage"->"Erase SD card".

Upvotes: 8

Jason LeBrun
Jason LeBrun

Reputation: 13293

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/*

Upvotes: 11

Mikecito
Mikecito

Reputation: 2063

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.

Upvotes: 1

chris polzer
chris polzer

Reputation: 3367

Delete the sdcard form the AVD manager and add a new one!?

Upvotes: 4

Bill Mote
Bill Mote

Reputation: 12823

When you launch the emulator there's a checkbox to wipe user data.

Upvotes: 0

Related Questions