LoginSignup
11
6

More than 5 years have passed since last update.

React Native の iOS のリリースビルドで console.log を出力する

Last updated at Posted at 2018-08-07

React Native は iOS のリリースビルドでは、console.log が一切表示されません。
ビルド時にログレベルを切り替える設定が見つからず、わりと悩んだのでメモしておきます。

AppDelegate.m の中でログレベルを明示的に設定してしまうのが、手早そうです。

AppDelegate.m
#import <React/RCTLog.h> // ← ここ追加

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  RCTSetLogThreshold(RCTLogLevelInfo); // ← ここ追加

上記のように書き換えてビルドすると、Xcode のコンソールにログが出てくるようになります。

11
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
11
6