user版本 shell用户 有读写权限的目录

  • /data/local/tmp
  • /storage/emulated/0/Download/

数据和文件存储概览  |  Android 开发者  |  Android Developers


https://developer.android.google.cn/guide/topics/manifest/manifest-element

adb shell pm get-install-location

adb shell pm set-install-location


 内部存储 & 私有存储 示例:

  • 应用专属存储空间
    • 内部存储器的专属目录
      • /data/user/0/com.tencent.mm/files
      • /data/user/0/com.tencent.mm/cache
    • 外部存储器的其他专属目录
      • /storage/emulated/0/Android/data/com.tencent.mm/files
      • /storage/emulated/0/Android/data/com.tencent.mm/cache
  • 偏好设置
    • /data/user/0/com.tencent.mm/shared_prefs
  • 数据库
    • /data/user/0/com.tencent.mm/databases

adb shell "find / -name com.tencent.mm 2>/dev/null"

adb shell ls -l /data/data/com.tencent.mm

adb shell ls -l /data/user/0/com.tencent.mm

adb shell ls -l /storage/emulated/0/Android/data/com.tencent.mm


由于Android支持多用户,/data/data/app_name代表当前用户的内部存储的私有数据

adb shell pm list users

adb shell "find / -name com.android.gallery3d 2>/dev/null" 

adb shell ls -l /data/data/com.android.gallery3d

adb shell ls -l /data/user/0/com.android.gallery3d

adb shell ls -l /data/user/10/com.android.gallery3d 


 示例:外部存储器 映射关系

/sdcard -> /storage/self/primary -> /storage/emulated/0 -> /dev/block/dm-12

adb shell ls -l /sdcard

adb shell ls -l /storage/self

adb shell mount | findstr storage

adb shell df

参考资料:

Android系统分区理解及目录细解_Karson Tiger的博客-CSDN博客_android分区

遗留问题:

android分区知识,特别的recovery分区的构成_nicholas_duan的博客-CSDN博客_recovery分区


外部存储 示例:

  • 外部存储器
    • 外部存储器的其他专属目录
      • /storage/emulated/0/Android/data/com.tencent.mm/files
      • /storage/emulated/0/Android/data/com.tencent.mm/cache
    • 共享目录
      • /storage/emulated/0/DCIM

adb shell "find / -name DCIM 2>/dev/null"

adb shell ls -l storage/emulated/0


 参考资料:

Android内、外存储 易混淆点剖析(/mnt/sdcard、/storage/sdcard0、/storage/emulated/0等区别)_u010227042的博客-CSDN博客_android mnt sdcard
彻底搞懂Android文件存储---内部存储,外部存储以及各种存储路径解惑_ 雨季莫忧离的博客-CSDN博客_android getabsolutepath

Logo

Agent 垂直技术社区,欢迎活跃、内容共建,欢迎商务合作。wx: diudiu5555

更多推荐