I created a new react-native project which spits out an Android project and an iOS project. I am using Swift, so I replace the AppDelegate.m
and AppDelegate.h
files with AppDelegate.swift
. I use the DEBUG
macro like this in the swift file but it is always set to false even in debug mode due to which I am not able to use it.
#if DEBUG
let jsCodeLocation = RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index", fallbackResource:nil)
#else
let jsCodeLocation = Bundle.main.url(forResource: "main", withExtension: "jsbundle")
#endif
I searched for debug
in Build Settings
on Xcode and I found the below which seems to be set correctly.
How can I assure that the DEBUG
macro is set while running the debug mode and not set otherwise. Thanks.