Android/iPhone 上的 JavaScript 调试
我在 sencha touch 方面遇到了一个奇怪的问题。我有一个应用程序,其中有选择字段,并且在更改选择字段值时,我根据我的业务规则应用一些规则。
规则
- 规则就像我从表单中删除所有字段元素并再次添加它们。
- 我保留以前选择的值,
- 从附加到选择字段的存储中删除一些值。
现在,它在 chrome、safari 浏览器和 iPad 设备浏览器上运行得非常好。但现在它在 iPhone 和 Android 设备上出现了奇怪的问题。屏幕卡住了。更改选择字段中的值后不允许发生任何事件。
采取的步骤; 另外,我在源代码的每一步都放置了警报作为记录器,以确保无限循环。 我还放置了异常处理程序以确保错误发生。没有错误,也没有无限循环运行,这可能会导致内存/运行时问题。
谁能给我提供一个调试器的链接,我可以在 android 或 iPhone 中使用它来调试 Sencha 框架中编写的 JavaScript 代码。
Edit-1
我从 sencha 门户遇到了 RemoteJS remote-javascript-debugging-on-android 另外,我已经安装了Android SDK和QT,bot不知道如何开始调试。
I have an strange problem with sencha touch. I have an application, where there are Select fields, And on change of select field value I am applying some rules, as per my business rules.
Rules are
- Rules is like i am removing all of the field elements from the form and adding them again.
- I am retaining the previous selected value
- Removing some values from the store attached to the select field.
Now, it is working absolutely fine with the chrome, safari browser and the iPad device browser. But now it is giving strange problem in iPhone and Android device. The screen gets stuck. No events are allowed after changing the value in select field.
Steps Taken;
Also, I have put alert as logger at each step of the source code to ensure the infinite loop.
I have also put the exception handlers to ensure the error occurred. No errors, neither ant infinite loop running which might cause memory/run-time issue.
Can anyone provide me link to the any debugger that I could use either in android or iPhone to debug the JavaScript code written in Sencha Framework.
Edit-1
I have come across the RemoteJS from sencha portal
remote-javascript-debugging-on-android
Also, I have installed Android SDK and QT, bot don't know how to start with debugging.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
无法透露有关您问题的 android 部分的任何信息。
Weinre 是在 iPhone 上进行 Javascript 调试时通常会提出的内容。
这里描述了另一种解决方案,但它仅适用于模拟器中的 IOS5。根据我自己的需要,我选择了这个,因为我的印象是它的设置更容易、更快捷。
http://hiediutley.com/2011/ 11/22/debugging-ios-apps-using-safari-web-inspector/ 。
Can't tell anything about the android-part of your question.
Weinre is something that gets usually proposed when it comes to Javascript-Debugging on the iPhone.
Another solution is described here, but it only work with IOS5 in the Simulator. For my own needs I choosed that one because I had the impression that it's easier and quicker to setup.
http://hiediutley.com/2011/11/22/debugging-ios-apps-using-safari-web-inspector/ .
这个解决方案是 iOS 6.0 的终极解决方案——它使所有其他解决方案都过时了。请参阅:有没有办法在 iPhone/iOS 中调试 JavaScript Safari 浏览器?
This solution is the ultimate as of iOS 6.0 -- it makes all other solutions obsolete. See: Is there a way to debug JavaScript in the iPhone/iOS Safari browser?
Chrome Android 浏览器具有远程调试功能 - 请参阅 https://developers.google.com /chrome-developer-tools/docs/remote-debugging
设置有点棘手,但为您的移动设备提供了一个普通的 chrome 开发者控制台。
Chrome Android browser has remote debugging - see https://developers.google.com/chrome-developer-tools/docs/remote-debugging
The setup is a bit tricky, but gives you a normal chrome developer console for your mobile.
我有一个问题,JS 在第一台 iPad 和 Android 上无法工作(它们都有旧版本的 Webkit),代码没有运行,并且有很多文件,所以我最终使用 ajax 获取每个文件并在 try catch 中调用 eval 。
正如您在代码中看到的,我将堆栈跟踪转储到预标记中。
我还发现 1st iPad 和 Andorid (2.3) 中的 webkit 不允许删除和默认属性(我认为这与 IE 相同)。
I have a problem with JS not working on 1st iPad and Android (they both have old version of Webkit), the code was not running and there where lot of files so I ended up with fetching each file using ajax and call eval in try catch.
as you see in the code I dump stack trace into pre tag.
I've also found that webkit in 1st iPad and Andorid (2.3) don't allow delete and default as properties (I think that's the same with IE).