Mac下的Chrome或Safari访问跨域设置,MBP上使用模拟器Simulator.app或iphone+Safari调试网页

Mac下的Chrome或Safari访问跨域设置:

mac下终端启动Chrome
$ open -a Google\ Chrome --args --disable-web-security

前端

/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --disable-web-security
mac下终端启动Safari(试过没用!)
open -a '/Applications/Safari.app' --args --disable-web-security

MBP上使用模拟器Simulator.app调试网页步骤:

  • 去App Store下载7以上的Xcode
  • lanuch启动Simulator.app,它的完整路径为:/Applications/Xcode.app/Contents/Developer/Applications/iOS Simulator.app
  • 等Simulator.app启动白苹果加载完后,在模拟器中用 Safari 打开你要调试的页面,再打开 Mac 上的 Safari,在“开发 > iOS Simulator”菜单下选中模拟器中打开的页面就能够调试了。若是没有“开发”菜单,请到“偏好设置 > 高级”中开启。
  • 用苹果然机+Safari调试也能够,这里没试,有兴趣的看下面的参考连接,调试前注意确保手机电脑是在同一个网段

以上是sv参考前端牛人分享的博文后实践的操做总结,详细请看:ios

原文:在 iOS 模拟器中调试 Web 页面
Safari 前端开发调试 iOS 完美解决方案(iPhone/iTouch 等)web

相关文章
相关标签/搜索