React Native: cannot see console.logs when launching application from Xcode

I'm struggling to get my code to work with react-native run-ios . The native code pulls out the old cached version of the javascript package, and I cannot figure out that it will save my life.

When I launch the application from Xcode, the application works fine. Fine!

The only problem is that when I run the application through Xcode, I cannot access javascript logs. I tried react-native log-ios , but this does not seem to show my logs. I tried "Turning on debugging in Chrome" from the simulator menu, but this option is not available to me when I launch the application from Xcode.

Does anyone have any thoughts on what could be happening here?

+7
ios xcode react-native
source share
2 answers

Option 1

console.log working. By default in iOS, it is registered in the debug panel inside Xcode. If you select the "Debug in Chrome" or "Debug in Safari" options from the shaking rage menu (โŒ˜+^+Z) , it will go to the browser console instead.

Option 2

With React Native 0.29, you can simply run the following to view the logs on the command line:

 $ react-native log-ios $ react-native log-android 

Option number 3

Step 1: cmd-d to bring up the debug menu

Step 2: disable "Debugging in Safari", and some messages will be printed in the output message, but not in the console messages. However, one of the magazine's messages says:

DEV === false, warning of the development level is disabled, performance optimization is enabled "This is due to the fact that I previously connected my project for testing on a real device using the command:

reaction-native package --minify This is included without "dev-mode". To enable dev messages, enable the -dev flag:

reactive native package --dev And console.log messages are back! If you are not attached to a real device, be sure to re-point jsCodeLocation in AppDelegate.m to localhost (I did!).

+7
source share

I also could not see the logs that I created, but I did not check the work through Xcode, etc., I solved the problem with this .

0
source share

All Articles