Skip to content

How to set IS_TESTING Environment Variable for Android #25695

Closed
@amadeu01

Description

@amadeu01

Here at https://facebook.github.io/react-native/docs/debugging#warnings is mention the variable

The usage of the variable can be found here:

constants.put(
"isTesting", "true".equals(System.getProperty(IS_TESTING)) || isRunningScreenshotTest());
constants.put("reactNativeVersion", ReactNativeVersion.VERSION);

However, I'm not sure we are able to change the value from gradle config or any sort of build configuration.

Also, I opened a question here
regarding to how set environment variable on android and the comment

the application code is running in Android, not on your development machine. There are no configurable system properties in Android, short of creating a custom ROM. If you want to have a system property on your development machine be embedded in your Android app. have your Gradle script use buildConfigField to put the system property value into BuildConfig, or use resValue to put the system property value in a string resource

suggest that is not possible to change the System.property of the emulator, or device.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Platform: AndroidAndroid applications.StaleThere has been a lack of activity on this issue and it may be closed soon.Type: DocsIssues concerning the docs are tracked elsewhere: https://github.com/facebook/react-native-website

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions