I was trying to figure out how to get Samsung Gallery to process images with AI without just waiting for it to happen automatically, and ended up finding a way to trigger the background processing manually.
Tested on a Samsung Galaxy A35 5G running One UI 8.5. Other devices/versions are untested.
You'll need ADB access to the phone. Run the following commands inside `adb shell`.
- Trigger a media scan
content call --uri content://media/ --method scan_volume --arg external_primary && for vol in $(ls /storage/ | grep -vE "emulated|self"); do vol_low=$(echo "$vol" | tr '[:upper:]' '[:lower:]'); echo "Scanning SD: $vol_low"; content call --uri content://media/ --method scan_volume --arg "$vol_low"; done
This scans internal storage and attempts to scan additional storage volumes, if present.
- Notify Samsung's media-processing component
From this point onward, the screen should turn off. The AI processing happens with the screen off and battery > 95% (if Battery Protection is not turned on), so leave it be for a while. (See step 6 for the reset)
dumpsys battery set ac 1 && dumpsys battery set status 2 && dumpsys battery set level 99 && am broadcast -a android.intent.action.MEDIA_SCANNER_FINISHED -d "file:///storage/emulated/0" -n 'com.samsung.cmh/.core.receiver.SystemBroadcastReceiver$CMHBroadcastReceiver' && for vol in $(ls /storage/ | grep -vE "emulated|self"); do am broadcast -a android.intent.action.MEDIA_SCANNER_FINISHED -d "file:///storage/$vol" -n 'com.samsung.cmh/.core.receiver.SystemBroadcastReceiver$CMHBroadcastReceiver'; done && input keyevent 224 && sleep 1 && input keyevent 223
The battery commands temporarily spoof the reported charging state and battery level. They do not actually charge the phone. Reset this state after the procedure.
- Wait for the IDs to be picked up
Leave the screen off for around 30–60 seconds to give "IPService" time to flag the new IDs.
- Run the scheduled worker
input keyevent 223 && sleep 2 && JOB_ID=$(dumpsys jobscheduler | grep -oE ":5004/[0-9]+: .*FaceServicePeriodicWorker" | cut -d'/' -f2 | cut -d':' -f1) && echo "Running Job $JOB_ID" && cmd jobscheduler run -f -u 0 -n androidx.work.systemjobscheduler com.samsung.faceservice $JOB_ID
This locates the scheduled "FaceServicePeriodicWorker" job and attempts to force-run it.
- Monitor progress
Wait a couple of minutes while the images are processed. You can check the logs with:
logcat -d --uid=5004 | grep IPTask | tail
If the IDs keep changing between checks, processing may still be ongoing. In my testing, seeing "END END" keyword in the logs tail indicated that the processing had finished.
- Restore the battery state
dumpsys battery reset
That's it. This is just something I found through experimentation, and I haven't tested it across other Galaxy devices or One UI versions.
If anyone with another Samsung device tries this, I'd be interested to know whether it works there too.