简体   繁体   中英

How to find file on android device

I have created this file on my device:

file:///data/user/0/io.ionic.starter/files/mypdf.pdf

But I can't figure out how to find that file manually using my android device. Any ideas? Note: I am using an emulator, Nexus 5X.

What do you mean by "manually"?

You can not access this file from another application on your Android device, such as a file manager or a PDF viewer.

This is because you created it inside your applications files directory, which is guarded by file system permissions and is only accessible to your application.

There are two exceptions to this rule:

  1. If your device is rooted, you can use Root explorer to find the file.
  2. If you created the file with "world readable" permission, another application can read it if it has the exact path (including full file name).
    Note this may not work on newer versions of Android.

If you wish to access the file from you PC to examine it, you can use adb pull command. Since you are using an emulator, ADB should be running as root.
If it is not, use adb root command to switch ADB to run as root, then you will have no problem accessing any directory on the phone.

Keep in mind, this will not work on a real phone with stock ROM, as ADB can not run with root privileges on production systems.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM