Recently in the HTML 5 game, published to the phone to visit the webpage is always puzzling problem, suffer from no remote debug function has not been found to find the problem.
This blog details the debugging methods for iOS, Android, and Windows phone:
http://developer.telerik.com/featured/a-concise-guide-to-remote-debugging-on-ios-android-and-windows-phone/
1. How to use
Connect to iphone under Mac It's really good to try.
Environment:
Mac OS 10.9 Mavericks, IOS 8.1
Steps:
1. On iphone, set-"safari-" Advanced-"open web Detector"
2. On Mac, Safari Preferences-"advanced-" Displays the development menu in the menu bar
3. Connect your phone, open a webpage on your phone safari, and add it to your home screen (you can't remotely debug a Web page that Sarafi directly, you can only test add to the home screen), and open the page from the shortcut icon on the home screen
4. On Mac on Safari's development menu bar, drop-down can see connected devices, hover to see Open Web page, click to open website Inspector
2. Memo
The Web Checker function is similar to the Firefox debugging function, you can set breakpoints, view variables, but did not find the watch variable function.
The log view of the console is also inconvenient, in order to check the log, I rewrite the log function, tied to the console, the log push to an array, so that the Web inspector can be found soon so log The release project uses UGLIFYJS's drop_console to directly remove all log calls.
Rewrite the Window.onerror method, can be more convenient to crawl the error, as long as the rewrite function to make a breakpoint, error will come in, you can see the stack of error messages.
function (ErrorMessage, Scripturi, linenumber, ColumnNumber, error) { // your handler}
For loading the game error can be set breakpoints, and then refresh in the Web Inspector Point, if the iOS device directly by pressing the home button will directly end the Web inspector, unable to find.
Use Safari to remotely debug an iOS device webpage