L.Learner
L.Learner

Reputation: 129

How to install react native android apk on physical device

I generated signed apk for react native application ,now i want to give distribute .How can others install it on their device.it gives error java.lang.RuntimeException: ReferenceError: Can't find variable: __fbBatchedBridge (:1) Because react-native server is not started.How can a third person install my applicaion.

What all settings do i need to do so that they simply install my application by installing the apk.

Upvotes: 0

Views: 1225

Answers (1)

Samuli Hakoniemi
Samuli Hakoniemi

Reputation: 19049

1) First create the bundle:

react-native bundle --platform android --dev false --entry-file index.android.js \
  --bundle-output android/app/src/main/assets/index.android.bundle \
  --assets-dest android/app/src/main/res/

2) Then assemble the release to install to:

cd android && ./gradlew assembleRelease && cd -

3) Then check that device is the only connected device with:

adb devices

4) And finally install the release:

cd android && ./gradlew installRelease && cd -

Step #2 is not mandatory, but it's generally good to create the release APK.

Upvotes: 2

Related Questions