Skip to content

Instantly share code, notes, and snippets.

@dhylands
Last active February 14, 2016 22:22
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save dhylands/6253999 to your computer and use it in GitHub Desktop.
Sets the "Disable ADB Timer" to zero, which disables the timer.
#!/bin/bash
# Disables the adb timeout
set -e
ADB=${ADB:-adb}
$ADB wait-for-device
B2G_PREF_DIR=/system/b2g/defaults/pref
TMP_DIR=/tmp/adb-timeout-prefs
rm -rf $TMP_DIR
mkdir $TMP_DIR
cat >$TMP_DIR/adb-timeout.js <<EOF
pref("b2g.adb.timeout-hours", 0);
EOF
$ADB root
$ADB wait-for-device
$ADB remount
$ADB push $TMP_DIR/adb-timeout.js $B2G_PREF_DIR/adb-timeout.js
$ADB shell "stop b2g; start b2g"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment