61

On the emulator, I downloaded an image from Google. I can find the image on the emulator, but I have no idea what the file location of the image is. To debug my app I need to know where that image is. How can I get the full path of the image?

Get Off My Lawn
  • 34,175
  • 38
  • 176
  • 338
  • Remember after you download the SDK you'll have to create AVD for each API level http://developer.android.com/tools/devices/managing-avds.html – Morrison Chang Oct 26 '12 at 23:34

8 Answers8

78

From the AVD documentation:

By default, the android tool creates the AVD directory inside ~/.android/avd/ (on Linux/Mac), C:\Documents and Settings\<user>\.android\ on Windows XP, and C:\Users\<user>\.android\ on Windows 7 and Vista.

Update (2020-02-22): This wording isn’t on the current documentation page anymore, but the location appears to be the same (C:\Users\<user>\.android\) on Windows 8 and 10.

nneonneo
  • 171,345
  • 36
  • 312
  • 383
13

The system images are downloaded in [ {android_version_home_dir}/sdk/system-images/{android-version-number}/system.img> ]

and the avd are created in C:\Users\.android\avd\ (windows) or ~/.android/avd/ (linux/mac)

Jerome
  • 1,153
  • 1
  • 17
  • 28
13

Not obvious thing in official documentation

Maybe this?

Dmitry Ivanov
  • 508
  • 7
  • 9
  • Oh my God, finally the answer I've been looking for! I've opened the emulator files directory through AVD manager (the way many people advised), but there are just a few directories and files, it never helped. Thank you! – Helen Oct 06 '21 at 17:05
4

This here seems to work for me:

String path = Environment.getExternalStorageDirectory().getPath();
String myJpgPath = path + "/Download/dog-best-friend-1.jpg";
Get Off My Lawn
  • 34,175
  • 38
  • 176
  • 338
4

On windows:-> C:\Users\yourUser\Documents\AndroidStudio\DeviceExplorer\Pixel_2_API_30 [emulator-5554]\data\data\com.yourpackage\files

After the emulator name, you can choose the path in your code.

Cabezas
  • 9,329
  • 7
  • 67
  • 69
3

In Windows ---> C:\Documents and Settings<user>.android\

Nehil Koshiya
  • 1
  • 2
  • 6
  • 23
2

If your image is stored on your emulator then you can find that image using file Explore

First Start your Emulator then:

Open your File Explorer and go to mnt/sdcard/Download you will find your image here if its downloaded.

To open file explore in Eclipse : window/show view/other/File Explore

Juned
  • 6,290
  • 7
  • 45
  • 93
2

To find the exact path open the emulator go to Photos then click on a photo (if there is any) then click on i (for info). There you can see the exact path on your device.To access these files dynamicly try:

    String path = Environment.getExternalStorageDirectory().getPath();
    String pathPhotos = path2 +"/Download";
    File[] fileArr = new File(pathPhotos).listFiles();

    for(int i = 0; i < fileArr.length; i++) {
        Log.d("fileName12", " " + fileArr[i].getPath());
    }

In case listFiles returns null you have to add:
uses-permission *android:name="android.permission.READ_EXTERNAL_STORAGE" /> And change the settings on the Emulator -> settings -> Apps -> App Permissions -> storage -> your app name -> switch on

mvz
  • 33
  • 4