Done web development on mobile before? RWD (responsive web design) stuff? If so, you will be troubled with the same thing all web developers do, the lack of a console to debug stuff when website are on the device itself. Well for that purpose we have a few solutions for that. What you need is a REMOTE DEBUGGER JUTSU!.
And today, I’m gonna walk you through the easiest way to setup a remote debugging server of your own.
There’s a free services like jsconsole.com and debug.phonegap.com … Why setup your own?
Good question, is because of latency speed as well as uptime reliability. With the server of your own, you can setup anytime you want within your own wifi network and there’s no latency or lag cross over Internet. Secondly, public debugging servers may be downed with too much connection.
Today’s method is using nodeJS to install weinre server. So what do we need?
- nodeJS installed to your system – if you want some intro on nodejs read my previous article [here]
- Create a folder to contained weinre.
- enter the folder in command prompt or console.
- type “npm install weinre”
- wait for it to dowload… and emmm thats it, what else you want, thats how awesome nodeJS is.
node weinre --boundHost -all-
The server will start in default port 8080. Make sure you u remember your IP. If you are on windows 8, for convinient sake you may install this app “What’s IP”, it display your ip and external one in a nice live tile, just a glance at one go.
Head towards your IP:8080, to communicate with your device it needs to be in the same wifi network and from your ip (do not use localhost), copy the portion name target script which looks like
Paste this code into your html file. thats it you are ready to go. Once you load the website on the mobile device. Check weinre website, and click on the link below Access Points
That’s it. Happy debugging. NINNJAA!