Skip to content

Instantly share code, notes, and snippets.

@kumar303
Last active December 14, 2015 07:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kumar303/5054419 to your computer and use it in GitHub Desktop.
Save kumar303/5054419 to your computer and use it in GitHub Desktop.
Turn on http logging for B2G
#!/bin/bash
#
# This is a script you can run to turn on HTTP
# logging for a B2G device.
# It's not fully automatic. It will start B2G on the
# the device with logging enabled but when you quit (^C)
# you have to pull the log down from the device like this:
#
# adb pull /data/local/tmp/http.log
#
# More info:
# https://developer.mozilla.org/en-US/docs/Mozilla/Debugging/HTTP_logging
#
adb shell stop b2g
echo "restarting with HTTP logging enabled"
echo "press control+C to quit"
# Clear out any old logs.
adb shell rm /data/local/tmp/http.log
# Reboot with just http request/response logging.
adb shell <<SHELL
#export NSPR_LOG_MODULES=timestamp,nsHttp:5,nsSocketTransport:5,nsHostResolver:5
export NSPR_LOG_MODULES=nsHttp:3
export NSPR_LOG_FILE=/data/local/tmp/http.log
/system/bin/b2g.sh
SHELL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment