有没有办法在iPhone / iOS的Safari浏览器来调试JavaScript? [英] Is there a way to debug JavaScript in the iPhone/iOS Safari browser?

查看:741
本文介绍了有没有办法在iPhone / iOS的Safari浏览器来调试JavaScript?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对iPhone浏览器奇怪的行为。有没有调试iPhone浏览器中的JavaScript工具?

我希望能有一些更先进的不是简单的警报()消息。是否与先进的工具,像设置断点和观察对象状态?


解决方案

使用的iOS 6的发布,苹果发布远程Web检查他们的移动Safari浏览器,这是巨大的。基本上,你拥有的全部功能和Web督察的权力定期Safari浏览器,为您的移动应用,包括应用程序的PhoneGap。

我使用

weinre 的但是这个工具使过时适用于iOS的新版本(不幸的是没有为旧版本的iOS,非iOS设备,或者如果你使用的是Windows)自一个功能全面的调试断点和一切。

要求:


  1. 在Mac的Safari 6 +

  2. 无论是USB连接的iOS设备6+或x code 4.5+上运行的是iOS 6+模拟器

如何激活督察:


  1. 在模拟器或设备上,打开设置>野生动物园>高级> Web检查>在结果
    (这是在默认情况下在模拟器)

  2. 在Safari 6以上版本的Mac,从开发菜单访问你的页面。您可以在Safari中启用的高级preferences制定菜单如果没有显示出来。


在底部

更多讨论:结果
<一href=\"http://www.mobilexweb.com/blog/iphone-5-ios-6-html5-developers\">http://www.mobilexweb.com/blog/iphone-5-ios-6-html5-developers

(另外,如果你读到一个秘密专用接口或iWebInspector的地方,这些也已过时。)

I have a strange behavior on the iPhone browser. Is there a tool to debug the JavaScript of the iPhone browser?

I'm hoping there's something more advanced than simple alert() messages. Is there something with advanced tools like setting breakpoints and viewing object states?

解决方案

With the release of iOS 6, Apple released Remote Web Inspector for their Mobile Safari, and this is huge. Basically you have all the features and power of Web Inspector in regular Safari, for your mobile apps, including Phonegap apps.

I've used weinre but this tool makes it obsolete for newer versions of iOS (unfortunately not for old versions of iOS, non-iOS devices, or if you're on Windows) since its a full-featured debugger with breakpoints and everything.

Requirements:

  1. A Mac with Safari 6+
  2. Either a USB-attached iOS 6+ device or xCode 4.5+ running an iOS 6+ simulator

How to activate the inspector:

  1. In your simulator or device, open Settings > Safari > Advanced > Web Inspector > On
    (this is on by default in the simulator)
  2. In Safari 6+ for Mac, access your page from the Develop menu. You can enable Develop menu in Safari's Advanced Preferences if its not showing up.

More discussion at the bottom of:
http://www.mobilexweb.com/blog/iphone-5-ios-6-html5-developers

(Also, if you read about a "secret private interface" or iWebInspector somewhere, these are also made obsolete.)

这篇关于有没有办法在iPhone / iOS的Safari浏览器来调试JavaScript?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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