Created
October 28, 2014 16:51
-
-
Save eliperelman/c34a4e1cb36d9cf8ba30 to your computer and use it in GitHub Desktop.
Enable/disable NSPR Logging
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Alias this script for easier experience | |
# Usage: | |
# ./nspr.sh on | |
# ./nspr.sh off | |
NSPR="export NSPR_LOG_MODULES=ObserverService:5" | |
OPTION=$1 | |
DISK_DEVICE=`adb shell mount | grep '/system' | awk '{ print $1 }'` | |
adb shell "mount -o remount,rw $DISK_DEVICE /system" | |
adb pull /system/bin/b2g.sh . | |
LINE2=`sed '2q;d' b2g.sh` | |
if [ "$OPTION" = "on" ] && [ "$LINE2" != "$NSPR" ]; then | |
sed -i "2i$NSPR" b2g.sh | |
elif [ "$OPTION" = "off" ] && [ "$LINE2" = "$NSPR" ]; then | |
sed -i '2d' b2g.sh | |
fi | |
adb push b2g.sh /system/bin/b2g.sh | |
rm b2g.sh | |
adb shell chmod 755 /system/bin/b2g.sh | |
adb shell chown root.shell /system/bin/b2g.sh | |
adb reboot |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment