Skip to content

Instantly share code, notes, and snippets.

@positlabs
Last active December 14, 2015 08: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 positlabs/5061437 to your computer and use it in GitHub Desktop.
Save positlabs/5061437 to your computer and use it in GitHub Desktop.
Starts an Android Debug Bridge server and opens a web page with a list of debuggable pages
#!/usr/bin/env python
# @author - positlabs
# @github - https://github.com/positlabs/
# @blog - http://pixel-fiend.positlabs.com/
#
# Debugger for Android running Chrome.
#
# First, set up your device and computer to work with adb: http://developer.android.com/tools/help/adb.html
#
# @note - to stop the server, call adb kill-server
# @note - if you get "error: device not found," try a different port number, or restart your device. You can check device connection status with Android File Transfer
import webbrowser
import os
portnumber = 1337;
#this thing fails the first time, every time. Killing and restarting the server fixes it.
os.system("adb forward tcp:1337 localabstract:chrome_devtools_remote")
os.system("adb kill-server")
os.system("adb forward tcp:1337 localabstract:chrome_devtools_remote")
webbrowser.open("http://localhost:" + str(portnumber))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment