Android-入门教程-内部存储/外部存储-概览


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

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值