Search code examples
c#androidxamarinfilesystemsvisual-studio-emulator

Find files with Android Device Monitor from Visual Studio Emulator for Android


I have created files with my app and I want to access the files with the Android Device Monitor. This is the path I used

string filepath = Path.Combine(Android.OS.Environment.ExternalStorageDirectory.AbsolutePath, 
                               Android.OS.Environment.DirectoryDocuments, "somefilename.txt")

As result I get the following path, when running on Visual Studio Emulator for Android:

/storage/emulated/0/Documents

If I start the ADM and look with File Explorer I can't find such folder. Because I'm on simulator I should be able to access the files I think. I only have the following similar (empty) folders:

storage/emulated/legacy
storage/sdcard0

Also under data/data/appName/ or data/media/0 there are no files at all. Am I using the wrong path? I don't want to use the real device, because you have to detach and re-attach the cable everytime to see if the files changed ...

If I try to use adb shell ls /storage/emulated/0/ I get

No such file or directory

Emulator is running Android 5.0 and the app is compiled with Android 6.0.


Solution

  • Seems that I found the right path to the symbolic link:

    /mnt/shell/emulated/0/Documents