Is there a way of running adb commands on all connected devices? To uninstall an app from all connected devices with \"adb uninstall com.example.android\".
The comma
To add in the ~/.bashrc or ~/.zshrc:
alias adb-all="adb devices | awk 'NR>1{print \$1}' | parallel -rkj0 --tagstring 'on {}: ' adb -s {}"
Examples:
$ adb-all shell date$ adb-all shell getprop net.hostname$ adb-all sideload /path/to/rom.zip$ adb-all install /path/filename.apk$ adb-all push /usr/local/bin/frida-server-arm64 /data/local/tmp/frida-serverExplanation: awk extracts the device id/host (first column: print $1) of every lines except the first one (NR>1) to remove the "List of devices attached" header line), then gnu parallel runs adb -s on whatever non-empty line (-r) in the order specified (-k, to avoid random order / fastest response order) and prepend each line with on for clarity, all in parallel (-j0, possible to set another number to define how many adb should be ran in parallel instead of unlimited).
:)