Android will automatically perform a media refresh when an SD card is mounted.
Using adb, we can fake that event by manually sending a
For example, if you wanted to run a media refresh of the entire SD card:
adb -d shell "am broadcast -a android.intent.action.MEDIA_MOUNTED -d file:///sdcard"
To refresh different directory, just change "/sdcard" to the absolute path of the directory you want to refresh.
For more fine-grained control, use the
intent, which triggers a rescan of a single file.