Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Mobile Web 开发实战

破锣锅
August 21, 2013

Mobile Web 开发实战

破锣锅

August 21, 2013
Tweet

More Decks by 破锣锅

Other Decks in Technology

Transcript

  1. Chrome  -  模拟开发阶段调试预览 Mobile  Devices  -  真机联调调试 flexCombo  -  CDN本地环境

    Apache  -  透明代理、本机DEMO Remote  Debug  -  远程调试 开发环境
  2. GMFY$PNCP npm install flex-combo sudo flex-combo -u /apps/et/trip-html5/act -c utf8

    $PNCP࠯ඌቋԚԛགྷჷႿuۚྟିຩᅟࡹഡᆷଲv֥ܿᄵ၂෮ิ֞oࡨഒ )551౨౰đ൞၂۱ᄝڛༀ؊ิ܂đކѩ؟۱໓ࡱ౨౰ᄝ၂۱ཙႋᇏ֥࠯ඌb ᄝളӁߌ࣢ᇏđ$PNCPۿିႵޓ؟ൌགྷđ২ೂ5FOHJOFbᄝభ؊षؿߌ࣢ᇏđ ႮႿቋᇔഈཌླေࡼሧჷႄೆ֥ս઒ކѩđՖط໭مᄝЧֹ౞ਈषؿט൫đႄఏ षؿט൫҂ьb'MFY$PNCP൞ᄝषؿߌ࣢ଆ୅ൌགྷਔՎۿି֥ڛༀఖđଢ֥ ൞ٚьభ؊षؿט൫bჿ֩Ⴟ၂۱ᆦӻ$PNCPეمđᆺି٠໙KTDTTࠣ๭ோሧ ჷ֥"QBDIFڛༀఖb౵љႿളӁߌ࣢֥$PNCPb'MFY$PNCPህູభ؊षؿ ߌ࣢ਈദյᄯđചఙ҆ٳۚѩؿหྟđՖطิ܂ਔپڶ֥ۿିބ౞ਈุ֥ࠒb
  3. Step: 1: Code 2: Preview in Browser 3: Enter URL

    on mobile Device 4-11: Repeat #3 (for 8 and more Devices) 12: Change Code 13: Preview in Browser 14-21: Refresh 8 Devices 22: Run into debugging need 关于调试  -  WORKFLOW
  4. Console HTML Inspector JavaScript Debug Network Inspector Performance Tips Modify

    CSS/JavaScript Memory Inspector Database Inspector etc. 关于调试  -  开发者工具  -  PC
  5. Console HTML Inspector JavaScript Debug Network Inspector Performance Tips Modify

    CSS/JavaScript Memory Inspector Database Inspector etc. 关于调试  -  开发者工具  -  Mobile
  6. 1. Safari Mobile Debugger 2. Webkit Remote Debugger 3. iWebInspector

    4. Opera Dragonfly 5. Chrome for Android Web Inspector 6. Firefox for Android Remote Debugging 7. Socketbug 8. weinre 9. jsconsole.com, jsbin.com 10. Adobe Edge Inspect
  7. "QBDIF ProxyRequests On ProxyVia On <Proxy *> Order deny,allow Deny

    from all Allow from all </Proxy> http:/ /httpd.apache.org/docs/2.2/mod/mod_proxy.html
  8. "QBDIF ProxyRequests On ProxyVia On <Proxy *> Order deny,allow Deny

    from all Allow from all </Proxy> http:/ /httpd.apache.org/docs/2.2/mod/mod_proxy.html
  9. 䔍ࠦॆ៽䕏时䝀调 • Chrome Remote Debugging on Android • iOS Remote

    Debugging with Safari • jsConsole Online • Webkit Inspector Remote(Weinre)
  10. $ISPNF3FNPUF%FCVHHJOHPO"OESPJE + Remote debugging on Device (using GDT) - Requires

    ADK/ADB, USB Cable (or hack) - Not for Android < 4 ICS, no Android 2/3! - A Lot to Setup/Maintain (for just a fraction) = Limited use for real world needs
  11. J043FNPUF%FCVHHJOH 1. Enable Web Inspector on your Phone 2. Connect

    your iPhone or iPad to your Mac 3. In Safari’s Preferences pane under Advanced, check the Show Develop menu in the menu bar checkbox. 4. Select the Develop menu, and your iDevice should be a menu option.
  12. J043FNPUF%FCVHHJOH + Convenient: Build in - No CSS/DOM Editing -

    No Breakpoints - JS Logs are truncated = Limited use for real world needs
  13. KT$POTPMF jsconsole.com is a simple JavaScript command line tool. However,

    it also provides the ability to bridge across to other browser windows to remotely control and debug that window - be it in another browser or another device altogether.
  14. KT$POTPMF + Remote DOM on Device + Any Browser/OS +

    Sits online, no local stuff to maintain + Truly remote - Console only - Needs JS inside your code to connect - Still need to go device by device = Powerful partial solution
  15. XFJOSF Weinre is a project of the Apache Foundation and

    stands for Web Inspector Remote and is exactly what it’s name suggests, a tool in the same vein as Firebug or Webinspector but, able to run and debug web pages remotely. So, if you have used tools such as the Firefox Developer Tools or Chrome Dev Tools, using Weinre will be second nature. Weinre Install • Start Server. • Add Bookmarklet. • Increase Auto-Lock Time(iOS Setting) to Prevent Disconnect. npm -g install weinre weinre --boundHost 127.0.0.1 --httpPort 9090 Another Option http://debug.phonegap.com
  16. XFJOSF + Remote DOM on Device + iOS, Android &

    BlackBerry + Node.js port now much less hairy to setup than former Java based one - Needs JS inside your code to connect - Still need to go device by device = Powerful partial solution
  17. 'JEEMFS The free web debugging proxy for any browser, system

    or platform. • Monitor HTTP/HTTPs traffic from any browser • Inspect and debug traffic from any client • Tamper client requests and server responses • Test the performance of your web sites and apps • Decrypt HTTPS web sessions • Extend Fiddler as much as you want
  18. $IBSMFT Charles is a web proxy (HTTP Proxy / HTTP

    Monitor) that runs on your own computer. Your web browser (or any other Internet application) is then configured to access the Internet through Charles, and Charles is then able to record and display for you all of the data that is sent and received. $50
  19. $IBSMFT • SSL Proxying – view SSL requests and responses

    in plain text • Bandwidth Throttling to simulate slower Internet connections including latency • AJAX debugging – view XML and JSON requests and responses as a tree or as text • AMF – view the contents of Flash Remoting / Flex Remoting messages as a tree • Repeat requests to test back-end changes • Edit requests to test different inputs • Breakpoints to intercept and edit requests or responses • Validate recorded HTML, CSS and RSS/atom responses using the W3C validator http://www.slideshare.net/keeganstreet/charles-13738910
  20. Native  H5混合编程 The "native bridge" technique is core to turn

    HTML 5 web pages into nation iOS / Android applications. As we described in earlier blog posts, the "native bridge" captures events from inside the web page, brings up native UI elements for the user to handle the event, and pass the results back into the page via a JavaScript call from the native app.
  21. http://tinypng.org/ imageAlpha imageOptim JPEGmini $ npm install -g imageoptim-cli $

    imageOptim -j -a -q -d path/to/images 性能优化实践  -  图片压缩工具
  22. • box-­‐shadow/text-­‐shadow • transition/transform • background:    gradient(...) • ...

    যႨ$44หྟ߶֝ᇁ်૫ᛴಙэતđݏ׮ིݔवؘčбೂඪཬ૜Ď 性能优化实践  -  请勿滥用CSS特性