Skip to content

Instantly share code, notes, and snippets.

@skellock
Created April 26, 2016 13:23
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skellock/b8513985e56b03a59963188803b4184e to your computer and use it in GitHub Desktop.
Save skellock/b8513985e56b03a59963188803b4184e to your computer and use it in GitHub Desktop.
Sends a shake command to each attach android device.
$ANDROID_HOME/platform-tools/adb devices | grep '\\t' | awk '{print $1}' | sed 's/\\s//g' | xargs -I {} $ANDROID_HOME/platform-tools/adb -s {} shell input keyevent 82
@chetandhembre
Copy link

On mac terminal instead of '\t' just use '\t' in above command.

@kosiakMD
Copy link

kosiakMD commented Jan 12, 2018

  1. where {} - device ID
  2. $ANDROID_HOME/platform-tools/adb is not necessary - I just use adb ...

@patrickmwatson
Copy link

patrickmwatson commented Sep 18, 2023

This simplified line worked for me, but I had to make sure I didn't have a xcode simulator window running at the same time strangely.

adb devices | grep '\t' | awk '{print $1}' | sed 's/\\s//g' | xargs -I {} adb -s {} shell input keyevent 82

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