Skip to content

Instantly share code, notes, and snippets.

@tolmachevroman
Created July 2, 2015 14:11
Show Gist options
  • Save tolmachevroman/73a6f421109fb6f8d04d to your computer and use it in GitHub Desktop.
Save tolmachevroman/73a6f421109fb6f8d04d to your computer and use it in GitHub Desktop.
This shell script allows you to emulate frequent connection drop outs on your device via ADB
for i in {1..5}
do
adb shell settings put global airplane_mode_on 1
adb shell am broadcast -a android.intent.action.AIRPLANE_MODE --ez state true
sleep $(( ( RANDOM % 10 ) + 10 ))
adb shell settings put global airplane_mode_on 0
adb shell am broadcast -a android.intent.action.AIRPLANE_MODE --ez state false
sleep $(( ( RANDOM % 10 ) + 10 ))
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment