How to view Android / data / your.package.name files on external storage in Android 4.2 using multi-user environment?

Android 4.2 has added multi-user support for tablets. Now, when you request a path to save files to external storage using a method of type Environment.getExternalStorageDirectory() or Context.getExternalFilesDir(null) , you get a value like: /storage/emulated/#/Android/data/your.package.name/ # is a number depending on which user you are logged in to as.

This works fine, but I noticed that DDMS File Explorer, as well as Android File Transfer, cannot see these files.

File Explorer Explorer does not see anything storage/emulated/ except for empty legacy . File Transfer can see the / Android / data / folder, but for an application running as debug, its files are not visible (but they exist).

Is there a way to get DDMS or File Transfer to work with these devices? (Hopefully without rooting the device ...)

thanks

+7
source share
2 answers

Yeah!

Try /mnt/shell/emulated/N , for different values โ€‹โ€‹of N as 0 . It seems to display correctly on my Nexus 10 and my Galaxy Nexus in DDMS. However, I cannot comment on the file transfer tool.

BTW, numbers are not consistent for users. So, on my N10, the original user is 0 , the second user is 10 .

+13
source

Since Jelly Bean 4.2 supports multi-user profiles, viewing sd cards has changed a bit.

You must have ADT v 21 or higher to view the emulated SD card. / mnt / shell / emulated / 0 for the default user. See attached image for more details. enter image description here

Enlarge image

+3
source

All Articles