Football Fans: Download the 2012 Schedule App from Google Play!


Go Back   Android Forums > Android Development > Application Development > Developer 101

Developer 101 101 Tutorials



Reply
 
LinkBack Thread Tools
Old December 14th, 2011, 03:17 PM   #1 (permalink)
Junior Member
 
Join Date: Oct 2011
Posts: 20
 
Device(s):
Thanks: 1
Thanked 0 Times in 0 Posts
Default How to access files in AVD SD card?

I have been generating a couple of custom gestures with the gesture builder (in Android Virtual Device Android 4.0) but I have no idea how to retrieve the files and save them into my local HD. Any information would be appreciated.

zollen is offline  
Reply With Quote
Sponsors
Old December 14th, 2011, 04:57 PM   #2 (permalink)
New Member
 
Join Date: Dec 2011
Posts: 8
 
Device(s):
Thanks: 0
Thanked 0 Times in 0 Posts
Wink Virtual SD Card

Hi!

So this is what I've found.. On the android forums they link to this for AVD support:

Using the Android Emulator | Android Developers

Within this page you can follow a link to this article (this will answer your question, the above link is for your reference):

Using the Android Emulator | Android Developers

In this article (and I can't test since I'm at work right now..) it seems you can state any directory (relative to your working directory) as a designated SD card repository. This is the command they suggest:

emulator -sdcard <filepath>

Let us know what you find, hopefully this helps.
Kupot is offline  
Reply With Quote
Old December 14th, 2011, 06:19 PM   #3 (permalink)
Junior Member
 
Join Date: Oct 2011
Posts: 20
 
Device(s):
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Kupot View Post
Hi!

So this is what I've found.. On the android forums they link to this for AVD support:

Using the Android Emulator | Android Developers

Within this page you can follow a link to this article (this will answer your question, the above link is for your reference):

Using the Android Emulator | Android Developers

In this article (and I can't test since I'm at work right now..) it seems you can state any directory (relative to your working directory) as a designated SD card repository. This is the command they suggest:

emulator -sdcard <filepath>

Let us know what you find, hopefully this helps.
Thanks for the reply. If I understood the article correctly, I believe the -sdcard option allows you to define the path where the sd repository is located (i.e sdcard.zip).

I am looking for a way (if possible) to extract files stored in the sd repository (i.e.sdcard.zip) and copy the contents to my local HD.
zollen is offline  
Reply With Quote
Old December 15th, 2011, 12:42 AM   #4 (permalink)
Premium Member
 
Join Date: Oct 2011
Location: Sydney, Australia
Posts: 193
 
Device(s): Galaxy Nexus GSM
Thanks: 2
Thanked 37 Times in 33 Posts
Default

The sdcard file created by avd won't be an archive file like a .zip file or such. It will be a "disk in a file". The file will contain the actual file-system sectors that would otherwise be on an actual SD card.

If you're using Linux, you can mount the SD card of an avd called myavd to /mnt using the loop device like so:
Code:
sudo mount -o loop -t vfat ~/.android/avd/myavd.avd/sdcard.img /mnt
If you're using Windows, well.... you're using Windows.
jiminaus is offline  
Last edited by jiminaus; December 15th, 2011 at 12:58 AM.
Reply With Quote
Old December 15th, 2011, 09:19 AM   #5 (permalink)
Junior Member
 
Join Date: Oct 2011
Posts: 20
 
Device(s):
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by jiminaus View Post
The sdcard file created by avd won't be an archive file like a .zip file or such. It will be a "disk in a file". The file will contain the actual file-system sectors that would otherwise be on an actual SD card.

If you're using Linux, you can mount the SD card of an avd called myavd to /mnt using the loop device like so:
Code:
sudo mount -o loop -t vfat ~/.android/avd/myavd.avd/sdcard.img /mnt
If you're using Windows, well.... you're using Windows.
Am I correct that after the mount was successful, I should be able to access any files that are stored in the virtual SD as if they are files in a regular file system?
zollen is offline  
Reply With Quote
Old December 15th, 2011, 11:31 AM   #6 (permalink)
New Member
 
Join Date: Dec 2011
Posts: 8
 
Device(s):
Thanks: 0
Thanked 0 Times in 0 Posts
Wink Windows Mount Workaround/Linux Loop Device Clar.

Quote:
Originally Posted by jiminaus View Post
If you're using Windows, well.... you're using Windows.
LOL - love it.

But there are ways around everything in the world of computers (just bear in mind, this will be tedious as all get-out). I found the instructions here:
Tutorial: Read/Write Android Emulator sdcard.img in Windows | deltafalcon's blog

As far as Linux goes, yes the "loop device" function will give you access like you had a physical USB installed/plugged in to the comp.
Kupot is offline  
Reply With Quote
Old March 20th, 2012, 09:32 PM   #7 (permalink)
New Member
 
Join Date: Dec 2011
Posts: 6
 
Device(s): Samsung Galaxy S
Thanks: 1
Thanked 1 Time in 1 Post
Default

Or use this command
adb pull path_to-file_on_sdcard path_to_save_on_your_pc

to put files there
adb push path_to-file_on_pc path_to_save_on_sdcard

navigate to the sdk tools directory first if adb is not in your PATH variable.
fixticks is offline  
Reply With Quote
The Following User Says Thank You to fixticks For This Useful Post:
zollen (March 21st, 2012)
Reply

Bookmarks


Go Back   Android Forums > Android Development > Application Development > Developer 101 User CP
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -5. The time now is 08:19 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Custom vBulletin Skins by: Relivo