Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to access local files of the filesystem in the Android emulator?

Tags:

android

I want to know whether there is a method to access local files (say text files, web pages) of the filesystem in Android emulator.

I'm using Ubuntu 10.04 for Android development.

like image 401
illuminatus Avatar asked Jan 31 '11 04:01

illuminatus


People also ask

How do I access files in Android Studio?

Right-click on a file or directory to create a new file or directory, save the selected file or directory to your machine, upload, delete, or synchronize. Double-click a file to open it in Android Studio. Android Studio saves files you open this way in a temporary directory outside of your project.

Where is the Android emulator folder?

The default location of this directory varies by platform: On Windows, it's the %LocalAppData%\Android\Sdk directory. This normally expands to C:\Users\<username>\AppData\Local\Android\Sdk , although it might vary based on your system.

Where are emulator files stored?

All applications and files that you have deployed to the Android emulator are stored in a file named userdata-qemu. img located in the C:\Users\<username>\. android\avd\<avd_name>. avd folder.

How do I transfer files from Android emulator to PC?

To copy a file from the connected emulator/device onto the computer, use the following command: adb.exe pull /data/app/<filename> c:\ NOTE When using the adb.exe utility to pull or push files from or into the emulator, ensure that only one AVD is running.


5 Answers

You can use the adb command which comes in the tools dir of the SDK:

adb shell

It will give you a command line prompt where you can browse and access the filesystem. Or you can extract the files you want:

adb pull /sdcard/the_file_you_want.txt

Also, if you use eclipse with the ADT, there's a view to browse the file system (Window->Show View->Other... and choose Android->File Explorer)

like image 106
Cristian Avatar answered Oct 02 '22 17:10

Cristian


In Android Studio 3.0 and later do this:

View > Tool Windows > Device File Explorer

like image 20
user3561494 Avatar answered Oct 02 '22 16:10

user3561494


In addition to the accepted answer, if you are using Android Studio you can

  1. invoke Android Device Monitor,
  2. select the device in the Devices tab on the left,
  3. select File Explorer tab on the right,
  4. navigate to the file you want, and
  5. click the Pull a file from the device button to save it to your local file system

Taken from Working with an emulator or device's file system

like image 42
Organic Advocate Avatar answered Oct 02 '22 16:10

Organic Advocate


In Android Studio 3.5.3, the Device File Explorer can be found in View -> Tool Windows.

It can also be opened using the vertical tabs on the right-hand side of the main window.

like image 40
DrMcCleod Avatar answered Oct 02 '22 17:10

DrMcCleod


Update! You can access the Android filesystem via Android Device Monitor. In Android Studio go to Tools >> Android >> Android Device Monitor.

Note that you can run your app in the simulator while using the Android Device Monitor. But you cannot debug you app while using the Android Device Monitor.

like image 31
oabarca Avatar answered Oct 02 '22 17:10

oabarca