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

Categories

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

javascript - console.log in pure React iOS app built with Cordova

Got assigned to a project that is built entirely in React (not React Native), but there's a branch off the main master branch which is used to do builds for iOS using XCode and Cordova and publishing in the App Store.

The project uses Redux and every action is logged to the console, which is fine for browsers, but it's hugely important to have access to the logs in dev mode, once the application is run in a simulator/iOS device.

So, my question is, how can I get access to these logs when I'm using the iOS Simulator?

Thanks in advance!

link to logs in browser

question from:https://stackoverflow.com/questions/65886717/console-log-in-pure-react-ios-app-built-with-cordova

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

1 Reply

0 votes
by (71.8m points)

The Cordova documentation has described the steps you need to take in such a situation and it's available for both Safari and Chrome (if you want to do some additional setup):

https://cordova.apache.org/docs/en/latest/guide/next/#safari-remote-debugging-with-web-inspector

So, basically, after you build the app, you need to launch the Safari Remote Debugger via Safari > Develop > [Device/Emulator] > [Name-of-your-app]


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

56.9k users

...