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

Android

Android Problem Overview


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.

Android Solutions


Solution 1 - Android

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)

Solution 2 - Android

In Android Studio 3.0 and later do this:

View > Tool Windows > Device File Explorer

Solution 3 - Android

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

Solution 4 - Android

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.

Solution 5 - Android

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.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionilluminatusView Question on Stackoverflow
Solution 1 - AndroidCristianView Answer on Stackoverflow
Solution 2 - Androiduser3561494View Answer on Stackoverflow
Solution 3 - AndroidOrganic AdvocateView Answer on Stackoverflow
Solution 4 - AndroidDrMcCleodView Answer on Stackoverflow
Solution 5 - AndroidoabarcaView Answer on Stackoverflow