使用Chrome DevTools调试iOS 6 + 7 Mobile Safari [英] Debug iOS 6+7 Mobile Safari using the Chrome DevTools

查看:627
本文介绍了使用Chrome DevTools调试iOS 6 + 7 Mobile Safari的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

iOS 6内置支持远程调试((iOS 7示例:)


信任当前连接电脑?


选择信任并尝试重新运行代理:

  ios_webkit_debug_proxy 



打开默认devtools



然后打开 http:// localhost:9221



DevTools是,默认,旧版本(来自Chrome 18,大约在2012年3月)。



尝试现代devtools



由于协议更改,现代DevTools前端的部分可能无法完全运行。您可以尝试打开

  chrome-devtools://devtools/bundled/inspector.html?ws = localhost:9222 / devtools / pag e / 2 

其中端口 page 值是您从 http:// localhost:9221 中看到的值。同样,这可能确实是错误的。



ios-webkit-debug-proxy项目页面






更新:这适用于 iOS7以及更新:通过 patrick 添加了新的devtools前端说明.. 更新 :将devtools.html更改为inspector.html for Chrome 45 ,以及新的 ws 通过Scheintod破解。


iOS 6 comes with built-in support for remote debugging (1 minute screencast). It plays nice with the new Safari Web Inspector which seems to be a 1 year old fork of WebKit Inspector. It misses some features such JS editing and WebSocket frames inspection.

Safari's Web inspector does use the WebKit remote debugging protocol. However, Safari does not use TCP/HTTP as a transport layer, thus making it incompatible with Chrome.

says Timothy Hatcher (aka Xenon), Apple employe

  • What does Safari use for transport layer?
  • Can I make a proxy from this mysterious transport layer to HTTP to make it work with Chrome DevTools?

解决方案

The iOS WebKit Debug Proxy project enables this.

To get started, install with homebrew:

brew install ios-webkit-debug-proxy

Run the simulator (if running simulator):

SIM_DIR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer
  "$SIM_DIR/Applications/iPhone Simulator.app/Contents/MacOS/iPhone Simulator" \
  -SimulateApplication \
  $SIM_DIR/SDKs/iPhoneSimulator6.1.sdk/Applications/MobileSafari.app/MobileSafari

Run the proxy:

ios_webkit_debug_proxy

Check for errors

Look on the device for an error message:

Could not connect to lockdownd. Exiting.: No such file or directory. Unable to attach inspector ios_webkit_debug_proxy

Then check the device for a prompt like this (iOS 7 example: )

Trust the currently connected computer?

Choose "Trust" and try rerunning the proxy:

ios_webkit_debug_proxy

Open default devtools

Then open http://localhost:9221

The DevTools are, by default, an older version (from Chrome 18 circa March 2012).

Try modern devtools

Due to protocol changes, parts the modern DevTools frontend may not work completely. You can try by opening

chrome-devtools://devtools/bundled/inspector.html?ws=localhost:9222/devtools/pag‌​e/2

where the port and page values are the values you're seeing from http://localhost:9221. Again, this may indeed be buggy.

Read more docs at the ios-webkit-debug-proxy project page.


Update: This works with iOS7 as well. Update: Added fresh devtools frontend instructions via patrick.. Update: Changed devtools.html to inspector.html for Chrome 45, and the new ws hack via Scheintod.

这篇关于使用Chrome DevTools调试iOS 6 + 7 Mobile Safari的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆