Reputation: 38988
Using the emulator, with external storage attached, I would like to emulate what happens when the application starts up and certain files are already present in the relevant directory on ext storage.
Is the external storage actually located on my machine, after enabling it in the AVD? Or should I be creating the files with some temporary, throw away code? Or should I just test on a real device?
What is best practice for this scenario?
Upvotes: 0
Views: 4895
Reputation: 72331
The easiest way of creating the SDCard
contents, would be to create the files that you need on your machine and then using the DDMS Perspective
in Eclipse
you can select your emulator
in the Devices
panel on the left, and then choose the FileExplorer
tab on the right. There is a folder named sdcard
which contains the SDCard
contents.
By using the controlls on the right upper-side you can create folders inside the SDCard
and by you can also Push
files on the emulators
SDCard
.
As @dtmilano said, you can also achieve the same thing using Command Prompt
.
Upvotes: 2
Reputation: 69368
The sdcard.img
is in the avd folder (~/.android/avd
). If you are using Linux or OSX you can mount it, manipulate the files inside, and unmount it.
Probably there's a program in Windows that let you do the same.
As an alternative, you can start the emulator and then manipulate the sdcard content using adb push/pull
or DDMS
.
Upvotes: 5