Skip to content

Instantly share code, notes, and snippets.

@raymondctc
Last active February 14, 2025 19:07
Show Gist options
  • Save raymondctc/9f1d3841e5af573a3be6 to your computer and use it in GitHub Desktop.
Save raymondctc/9f1d3841e5af573a3be6 to your computer and use it in GitHub Desktop.
Batch install apks to multiple connected devices
#!/bin/sh
adb devices | tail -n +2 | cut -sf 1 | xargs -I \{\} -P4 adb -s \{\} install -r $1
@raymondctc
Copy link
Author

@user2user1
tail -n +2

  • Skips the first line of adb devices output (which is just a header).
  • Since the output of adb devices looks like this:
List of devices attached
emulator-5554   device
emulator-5556   device

Here, the first line is not needed, so tail -n +2 removes it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment