Mobile-side Debugging Tools

Source: Internet
Author: User
<span id="Label3"></p><span style=""><span style=""><span style="font-size:14px">Weinre can achieve similar features of chrome development tools, JS error should be manually printed display; <span style="white-space:pre"></span> </span></span></span><span style="font-size:14px"><span style="font-size:14px">Rosin is a fiddle plug-in, mobile phone through the fiddle agent online, Rosin can print out a variety of console information, no need to manually adjust the code;</span></span><span style="font-size:14px"><span style="font-size:14px">Browser-sync is an automatic refresh tool with the following installation Methods:</span></span><span style="font-size:18px"><span style="font-size:18px"><strong><br></strong></span></span><span style="font-size:18px"><span style="font-size:18px"><strong>first, weinre</strong></span></span><span style="font-size:12px"><span style="font-size:12px">1. installation: npm-g install weinre</span></span><span style="font-size:12px"><span style="font-size:12px">2. operation: weinre--boundhost-all-</span></span><span style="font-size:12px"><span style="font-size:12px">3. Open the homepage, click the link Debug Client user interface:http://localhost:8080/client/#anonymous</span></span><span style="font-size:12px"><span style="font-size:12px">4. Add the Weinre script to the page that requires remote debugging (change localhost to your actual ip)</span></span><span style="font-size:12px"><span style="font-size:12px"><script src= "http://localhost:8080/target/target-script-min.js#anonymous" ></script></span></span><span style="font-size:12px"><span style="font-size:12px">5. Display Debug Page http://localhost:8080/client/#anonymous</span></span><span style="font-size:12px"><span style="font-size:12px"><br></span></span><span style="font-size:12px"><span style="font-size:12px"> <strong>test results: Some styles modified after the phone has no effect, JS error can not be directly automatically thrown, the try catch by the e.message in the console print out, in the code execution sequence has a delay, need to wait for debugging</strong> Target-script-min.js <strong>Loading is complete before printing. </strong></span></span><strong><strong><span style="font-size:12px">such as:</span></strong></strong><pre code_snippet_id="652398" snippet_file_name="blog_20150424_2_3416032" name="code" class="javascript"><pre code_snippet_id="652398" snippet_file_name="blog_20150424_2_3416032" name="code" class="javascript">try{ if (w>b) { console.log ("one");} } Catch (err) { setTimeout (function () { console.log (err.message); },3000) //3s after printing error, You can also press the button on the page to print after the page has finished loading}</pre></pre>1, installation: npm-g Install weinre2, run: weinre--boundhost-all-3, Open the homepage, click the link Debug Client user interface:http://localhost:8080/c Lient/#anonymous<span style="font-size:12px"><span style="font-size:12px">4. Add the Weinre script to the page that requires remote debugging (change localhost to your actual ip)</span></span><span style="font-size:12px"><span style="font-size:12px"><script src= "http://localhost:8080/target/target-script-min.js#anonymous" ></script></span></span><span style="font-size:12px"><span style="font-size:12px">5. Display Debug Page http://localhost:8080/client/#anonymous</span></span><span style="font-size:12px"><span style="font-size:12px"><br></span></span><span style="font-size:12px"><span style="font-size:12px"> <strong>test results: Some styles modified after the phone has no effect, JS error can not be directly automatically thrown, the try catch by the e.message in the console print out, in the code execution sequence has a delay, need to wait for debugging</strong> Target-script-min.js <strong>Loading is complete before printing. </strong></span></span><strong><strong><span style="font-size:12px">such as:</span></strong></strong><pre code_snippet_id="652398" snippet_file_name="blog_20150424_2_3416032" name="code" class="javascript"><pre code_snippet_id="652398" snippet_file_name="blog_20150424_2_3416032" name="code" class="javascript">try{ if (w>b) { console.log ("one");} } Catch (err) { setTimeout (function () { console.log (err.message); },3000) //3s after printing error, You can also press the button on the page to print after the page has finished loading}</pre></pre>weinre:http://people.apache.org/~pmuellr/weinre/docs/latest/http://blog.csdn.net/spring21st/article/details/ 8932839http://www.cnblogs.com/shawn-xie/archive/2012/12/10/2811206.htmlhttp://ju.outofmemory.cn/entry/1355<br><br><strong><strong>2, rosin (recommended)</strong></strong><span style="font-size:12px"><span style="font-size:12px">is a fiddle plug-in, developed by alloyteam, to receive the output of the console in the page</span></span><span style="font-size:12px"><span style="font-size:12px">source: http://www.alloyteam.com/2015/03/mobile-web-debug-tool-rosin/</span></span><span style="font-size:12px"><span style="font-size:12px">Project Address: http://alloyteam.github.io/Rosin/</span></span><span style="font-size:12px"><span style="font-size:12px">:</span></span><span style="font-size:12px"><span style="font-size:12px">roisn for Fiddler2</span></span><span style="font-size:12px"><span style="font-size:12px">roisn for Fiddler4</span></span><span style="font-size:12px"><span style="font-size:12px"><br></span></span><span style="font-size:12px"><span style="font-size:12px">1. Open fiddler, switch to Rosin Tab</span></span><span style="font-size:12px"><span style="font-size:12px">2. Click the "add rule" button to open the Rule Add Panel</span></span><span style="font-size:12px"><span style="font-size:12px">3, Select the rule match type, support three kinds of match type:</span></span><span style="font-size:12px"><span style="font-size:12px">host--domain name, such as: qq.com</span></span><span style="font-size:12px"><span style="font-size:12px">Path--path or specific page address, such as: http://web.p.qq.com/coupon or http://web.p.qq.com/coupon/demo.html</span></span><span style="font-size:12px"><span style="font-size:12px">regex--regular expressions, such as: ^http:\/\/web.p.qq.com</span></span><span style="font-size:12px"><span style="font-size:12px">4, Enter the specific rules content</span></span><span style="font-size:12px"><span style="font-size:12px">5. Open the test page, call the console to log in the test page code, or simulate in the PC console</span></span><span style="font-size:12px"><span style="font-size:12px">6, go back to fiddler, switch to rosin log tab, Select our test page, view the log</span></span><span style="font-size:12px"><span style="font-size:12px">7. For complex objects, Double-click the object character area to select, then right-</span></span><span style="font-size:12px"><span style="font-size:12px">8. Complex objects will be converted to JSON objects, creating a JSON View</span></span><span style="font-size:12px"><span style="font-size:12px">9, Functional area, Some function buttons, including: log file export, log emptying, log file deletion</span></span><span style="font-size:12px"><span style="font-size:12px">10, Search function, Enter text in the search box, will automatically highlight the matching results, press ENTER to toggle the matching area</span></span><span style="font-size:12px"><span style="font-size:12px">11. JavaScript Runtime error message capture, and support for Cross-domain capture (remember those script.error 0 errors)</span></span><span style="font-size:12px"><span style="font-size:12px"><br></span></span><span style="font-size:12px"><span style="font-size:12px">JS Error capture: log level Select All or error, you can see the error prompt, right-click object to view the specific information and error line number</span></span><span style="font-size:12px"><span style="font-size:12px"></span></span><span style="font-size:12px"><span style="font-size:12px"></span></span><strong><strong><span style="font-size:12px"><br></span></strong></strong><strong><strong><span style="font-size:12px">Mobile packet capture and matching hosts</span></strong></strong><span style="font-size:12px">on <span style="font-size:12px">the pc, we can easily match the host, but it is a problem how to match the host on the PHONE. </span></span><span style="font-size:12px"><span style="font-size:12px">here the main use of fiddler and remote agents, to achieve the mobile phone with host operation, The specific operation is as Follows:</span></span><span style="font-size:12px"><span style="font-size:12px">1. First of all, to ensure that the PC and mobile devices under the same lan;</span></span><span style="font-size:12px"><span style="font-size:12px">Open Fiddler on 2.PC and tick "allow remote computers to connect" in Settings</span></span><span style="font-size:12px"><span style="font-size:12px"></span></span><span style="font-size:12px"><span style="font-size:12px">3. Set the agent on the phone, proxy IP is the IP address of the pc, the port is 8888 (this is the default port of fiddler). Usually the phone can be directly set up the agent, if not, you can download a call Proxydroid app to implement the proxy settings. </span></span><span style="font-size:12px"><span style="font-size:12px">4 At this point you will find that using mobile internet, walking is actually the Fiddler on the pc, all the request package will be listed in the fiddler, with Willow use, you can achieve with host, or even reverse proxy operation (can also be configured by the Hosts file implementation). </span></span><span style="font-size:12px"><span style="font-size:12px"><br></span></span><span style="font-size:12px"><span style="font-size:12px">http://www.cnblogs.com/shawn-xie/archive/2012/12/10/2811206.html</span></span><br><br><br><strong><strong>3, different clients automatically refresh, node under the installation of Browser-sync (similar to F5)</strong></strong><span style="font-size:12px"><span style="font-size:12px">http://www.cnblogs.com/kbqncf/p/4206244.html</span></span><span style="font-size:12px"><span style="font-size:12px">installation: npm install-g browser-sync</span></span><span style="font-size:12px"><span style="font-size:12px"><br></span></span><span style="font-size:12px"><span style="font-size:12px">A, The local does not build a server environment<br>For simple static pages, we need to use The--server command to Browser-sync.<br>Assuming that my static pages are all in the C:\wamp\www\openadmin\style\html\ directory,<br>Enter into C:\wamp\www\openadmin via the console (that is, change the directory to the root of the server), typing the following command:<br>Browser-sync start--server--files "style/html/*.html"</span></span><span style="font-size:12px"><span style="font-size:12px">Access Address: http://localhost:3000/style/html/module.html</span></span><span style="font-size:12px"><span style="font-size:12px"><br></span></span><span style="font-size:12px"><span style="font-size:12px"><br></span></span><span style="font-size:12px"><span style="font-size:12px">B, The Local has built the server environment<br>Local server Set up Vhost local.openadmin.com point to C:\wamp\www\openadmin\ directory<br>Run:<br>Browser-sync start--proxy local.openadmin.com--files "style/**"</span></span><p><p>Mobile-side Debugging Tools</p></p></span>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.