Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
887 views
in Technique[技术] by (71.8m points)

xcode - console.log not working in an iOS PhoneGap 3.0 app

I am upgrading an app from PhoneGap 1.9 to PhoneGap 3.0. The console.log() function is not working anymore. Previously, the ouput was written in the XCode console. What's the best way to restore the logging feature?

I have read: PhoneGap 2.0 doesn't show console.log in XCode but in PhoneGap 3.0 console.log does not work even after the deviceReady event.

I am also interested to see the javascript errors directly in xcode.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You need the debug console plugin added to your project:

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

In later versions of phonegap/cordova, to add the debug console plugin in your project:

cordova plugin add org.apache.cordova.console


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...