Hope it works:
adb shell “pm list packages -f | while IFS=: read -r _ pkg; do \ dumpsys package \”$pkg\" | grep -q ‘<permission here>’ && echo $pkg; \ done"
Not said in a bad way but if you do a quick search gives you can get this …stackexchange.com/…/how-to-list-all-apps-with-a-…
gist.github.com/…/a880b01690eb437d4dd4d610db50e0a… this for a list of all permissions