开发者

Viewing Console.log in ios simulator

Please excuse my silliness. I feel as this should be a simple problem. I am using phonegap to develop in IOS. I am wondering how come console.debug does not show up i开发者_StackOverflow中文版n the xcode console. How can I view any javascript error or exception in xcode console or anywhere? I am running on 4.3 IOS IPAD simulator. Thanks.


You can watch the console.log with a safari-browser. Open the ios-simulator or connect the ipad by usb. Open safari and take a look in the menu "developer". Choose your web-site and the web-inspector will open.

more info here:

https://developer.apple.com/library/ios/documentation/AppleApplications/Reference/SafariWebContent/DebuggingSafarioniPhoneContent/DebuggingSafarioniPhoneContent.html


As far as I know, you cannot. I have solved this problem by using jsconsole.com. It allows you to output console message (and much more) by simply adding a script tag to your app.

NOTE: for debug use only.


Just to clarify the old answer from Fischel, here is the menu on a desktop Safari that allows you to connect development tools to simulators or devices.

Viewing Console.log in ios simulator

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜