3

The scenario is that my app is creating some files on its external storage /sdcard/Android/data/myPackageName and during testing automation I need to retrieve some files from that folder using adb.

The compileSdkVersion and targetSdkVersion are set to 31, and also uses:

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

For some reasons, the adb pull command doesn't work (permission denied) on Android 11 but it works on Android 13 (I used real phones not emulators)

These are the mount points:

Android 13

/dev/block/dm-40 on /storage/emulated/0/Android/data type f2fs (rw,lazytime,seclabel,nosuid,nodev,noatime,background_gc=on,discard,no_heap,user_xattr,inline_xattr,acl,inline_data,inline_dentry,flush_merge,extent_cache,mode=adaptive,active_logs=6,reserve_root=32768,resuid=0,resgid=1065,inlinecrypt,alloc_mode=default,checkpoint_merge,fsync_mode=nobarrier,discard_unit=block)

Android 11

/dev/block/dm-12 on /storage/emulated/0/Android/data type f2fs (rw,lazytime,seclabel,nosuid,nodev,noatime,background_gc=on,discard,no_heap,user_xattr,inline_xattr,acl,inline_data,inline_dentry,flush_merge,extent_cache,mode=adaptive,active_logs=6,reserve_root=32768,resuid=0,resgid=1065,inlinecrypt,alloc_mode=default,fsync_mode=nobarrier)

(the only differences are: discard_unit=block and checkpoint_merge)

I read a lot of SO posts, Android documentation etc and but I wasn't able to figure out the reason why this is happening. Why it works on 13 and not on 11? Any idea?

Lino
  • 5,084
  • 3
  • 21
  • 39

0 Answers0