103

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.

user1892364
  • 259
  • 2
  • 12
illuminatus
  • 1,986
  • 4
  • 16
  • 19

6 Answers6

108

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)

Cristian
  • 198,401
  • 62
  • 356
  • 264
  • Recommended use to get sdcard path: File sd = Environment.getExternalStorageDirectory(); String path = sd.getAbsolutePath(); – Edgard Leal Jan 31 '14 at 13:49
  • The GUI view is ultimately a function of DDMS, and so while it can be launched from within Eclipse, it can also be used by running DDMS without Eclipse. (Though personally I always use the command line adb tools). – Chris Stratton May 27 '14 at 16:36
  • 2
    On a recent install the exe location is "path\to\sdk\platform-tools\adb.exe" –  Mar 18 '16 at 04:01
  • This solution worked for me after launching the emulator from the command line whereas the Android Studio solution did not. – varogen May 01 '18 at 22:33
  • 'adb' is not recognized once I'm inside the shell, and if I try to navigate to the file, I get 'Permission denied'. Any ideas? – Felipe Centeno Apr 02 '19 at 16:34
  • Here is where to find the adb command: https://android.stackexchange.com/a/94049/65728 – qwertzguy Apr 08 '19 at 04:57
98

In Android Studio 3.0 and later do this:

View > Tool Windows > Device File Explorer

user3561494
  • 2,164
  • 1
  • 20
  • 33
49

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

Community
  • 1
  • 1
Organic Advocate
  • 919
  • 1
  • 15
  • 16
  • 9
    file explorer is empty – Stepan Yakovenko Jan 24 '17 at 20:37
  • 11
    To open `Android Device Monitor`, double press Shift (in Android Studio) and type in `"Android Device Monitor"`. – c0dehunter Jul 14 '17 at 15:03
  • Is it possible to rename a file or folder with the Android Device Monitor? – Alex Apr 01 '20 at 15:35
  • 4
    **Android Device Monitor deprecated**. https://developer.android.com/studio/profile/monitor "Android Device Monitor was deprecated in Android Studio 3.1 and removed from Android Studio 3.2. The features that you could use through the Android Device Monitor have been replaced by new features. The table below helps you decide which features you should use instead of these deprecated and removed features." – sancho.s ReinstateMonicaCellio Feb 15 '21 at 15:29
5

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.

DrMcCleod
  • 3,865
  • 1
  • 15
  • 24
1

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.

dev4life
  • 10,785
  • 6
  • 60
  • 73
0

To open the Device Explorer, select View > Tool Windows > Device Explorer or click the Device Explorer button in the tool window bar.

https://developer.android.com/studio/debug/device-file-explorer

Select a device from the drop-down list.

Interact with the device content in the file explorer window: Right-click a file or directory to create a new file or directory. Save, upload, delete, or synchronize the selected file or directory to your machine.

Double-click a file to open it in Android Studio.