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 模拟器中调试 Web 页面
Safari 前端开发调试 iOS 完美解决方案(iPhone/iTouch 等)


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM