Skip to content

wavemaker/wm-reactnative-cli

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wm-reactnative-cli

A command line utility to build react native apps created using WaveMaker product.

The main goal of wm-reactnative-cli is to simplify generation of APK or IPA for WaveMaker developers. wm-reactnative-cli combines multiple react-native commands into a single command. First, one has to make sure all the required hardware and software are available and installed. Then execute the command with the appropriate values for arguments.

Command to Install

npm install -g @wavemaker/wm-reactnative-cli

Android Build

Requirements

Adding Environment Variables

For Windows

  • Go to System Setting and Select Environment Varialbes.

    Windows System settings

  • Select New Variable under System section and add variables and their respective paths. New System Variable

For Linux/MAC

  • use nano ~/.bashrc then add the following at the end of the file (after updating the paths) and save it.
export JAVA_HOME="/usr/lib/jvm/java-11-openjdk-amd64"
export ANDROID_HOME="/usr/lib/android-sdk"
export ANDROID_SDK="/usr/lib/android-sdk"
export ANDROID_SDK_ROOT="/usr/lib/android-sdk"
export GRADLE_HOME="$HOME/gradle/gradle-7.5.1"

Command

wm-reactnative build android <src_dir> [additional_arguments]

                   Argument                    Description
src_dir DEFAULT: current working directory.
Path to the reactnative expo zip (or) path to the reactnative expo project folder.
--dest OPTIONAL: directory where the app has to be copied and built. If it is not specified then .wm-reactnative-cli folder inside the home directory, will contain the build folders
--auto-eject OPTIONAL: On setting this flag to true, expo eject will be invoke automatically.
--aKeyStore Absolute path of the key store. If keystore is not given then android debug key is used.
--aStorePassword Password to key store
--aKeyAlias Alias name of the key
--aKeyPassword Key Password
--buildType DEFAULT: development
development or production
Use ‘production’ with keystore specified.

Example 1

wm-reactnative build android "/path/to/src"

Example 2

wm-reactnative build android "/path/to/src" \
--dest="/path/to/dest" \
--aKeyStore="/path/to/file.keystore" \
--aStorePassword="store_password" \
--aKeyAlias="key_alias_name" \
--aKeyPassword="key" \
--buildType="production"
--auto-eject=true

IOS build

Requirements

NOTE: Before building an app, please make sure that neither iPhone nor iPad is not connected to Mac.

Command

wm-reactnative build ios <src_dir> [additional_arguments]

                   Argument                      Description
src_dir DEFAULT: current working directory.
Path to the reactnative expo zip (or) path to the reactnative expo project folder.
--dest OPTIONAL: directory where the app has to be copied and built. If it is not specified then .wm-reactnative-cli folder inside the home directory, will contain the build folders
--auto-eject OPTIONAL: On setting this flag to true, expo eject will be invoke automatically.
--iCertificate Absolute path of P12 certificate location
--iCertificatePassword Password to unlock the certificate.
--iProvisioningFile Absolute path of provisioning file
--iCodeSigningIdentity Signing certificate name in keychain access
--buildType DEFAULT: development
development or production
Use ‘production’ with an AppStore distribution certificate.

Example

wm-reactnative build ios "/path/to/src" \
--iCertificate="/path/to/distribution.p12" \
--iCertificatePassword="unlock_password" \
--iProvisioningFile="/path/to/profile.mobileprovision" \
--iCodeSigningIdentity="certificate name in keychain access" \
--buildType="production"

Run Expo

Requirements

Command

wm-reactnative run expo <preview_url> [additional_arguments]

                   Argument                      Description
preview_url app preview url
--clean DEFAULT: false
if true, existing project directory is removed

Run web-preview

Requirements

Command

wm-reactnative run web-preview <preview_url> [additional_arguments]

                   Argument                      Description
preview_url app preview url
--clean DEFAULT: false
if true, existing project directory is removed

Run Android

Command

wm-reactnative run android <preview_url> [additional_arguments]

                   Argument                      Description
preview_url app preview url
--clean DEFAULT: false
if true, existing project directory is removed

Run iOS

Requirements

Command

wm-reactnative run ios <preview_url> [additional_arguments]

                   Argument                      Description
preview_url app preview url
--clean DEFAULT: false
if true, existing project directory is removed

Additional Information

  1. Destination folder path is logged at the start of the build.
  2. Build log files are present at <destination_folder>/output/logs
  3. The artifact built is available at <destination_folder>/output/<platform_type>/. The complete path is printed in log also.

About

cli for building react native apps

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 94.9%
  • Java 1.6%
  • Objective-C 1.1%
  • Other 2.4%