Before android 11, I can use adb push images to /sdcard/DCIM/
directory and use am broadcast -a android.intent.action.MEDIA_SCANNER_SCAN_FILE -d <file path>
, then images will show in gallery.
Now I find this approach doesn't work in android 11 emulator, images are pushed to devices, but they won't show without a restart.
Is there anyway I can transfer images from host to emulator and make them appear in photo gallery?
Try:
adb shell am broadcast -a android.intent.action.MEDIA_SCANNER_SCAN_FILE\
--receiver-include-background -d file:///sdcard
Where you can replace /sdcard
with the actual path or directory.
https://android.googlesource.com/platform/system/sepolicy/+/85d87cfa6eb808b424f89f41269a3d63586df707%5E%21/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With