See Phonegap Console Log on iOS devices.

I am writing a PhoneGap application and it is already running on Android, but something is not working on the iPhone. What's even sadder, I can't see the results of console.log to figure out what is wrong. I can make alerts, but that’s not enough, because I can’t catch the errors.

In Android, I see everything in the LogCat window. Is there something similar in iPhone / ios?

Thanks.

+4
source share
4 answers

For web development on mobile, I use Weinre for debugging. It redirects console.log to the remote debugging window and should work with Phonegap.

+4
source

JSConsole: http://jsconsole.com/

This is the best for this purpose, I have successfully used it with applications for iOS and Android PhoneGap / Cordova. You execute JavaScript commands from your browser remotely on the device, and you also see console output. No plugins required. This is just a matter of an additional tag. Just remember to grab it before releasing it on the App Store / Google Play.

+4
source

I previously wrote this answer to enable console.log logging on xCode in common iOS UIWebViews.

This approach also works in telephone records:

  • Uncomment the function 'shouldStartLoadWithRequest' in MainViewController.m in
  • Follow these instructions.
+1
source

Try using Safari (not Xcode)

Instructions: http://phonegap-tips.com/articles/debugging-ios-phonegap-apps-with-safaris-web-inspector.html

Works: https://www.youtube.com/watch?v=c6eB5TWx0vk


Perhaps you are missing a plugin? See the following: console.log does not work in iOS PhoneGap 3.0 application

phonegap local plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-console.git 
0
source

Source: https://habr.com/ru/post/1396384/


All Articles