-2

I wrote a very nice application for personal use in React Native. I'm surprised I can't build it and run it on my phone. In ReactJS, this is done in one command, doesn't React Native have an easy way to do this? I've tried a lot already. I got the AAB file and tried running it with APKMirror Installer and other apps. This doesn't work.

  • Does this answer your question? [Deploy/Publish Android app made with React Native](https://stackoverflow.com/questions/32783344/deploy-publish-android-app-made-with-react-native) – Vasyl Nahuliak May 21 '23 at 08:19
  • You should add more details. – Halil Ozel May 21 '23 at 11:17
  • No. The answer to this question did not help me. I don't want to publish the app on Google Play. I want to install it on my phone. Now I connect the phone to the computer using USB and start the application with the command "npx expo start --tunnel" (other commands do not start) but now the application is ready and I want to install it not on the phone, like other applications. In ReactJS, I run the "react-scripts build" command and I get a ready application folder. Can't I do the same in React Native? – Игорь Мешалкин May 22 '23 at 11:11

1 Answers1

1

If you're using expo library, it will be very easy, all you need to do is scan qrcode when running it by

expo start

If you're using without expo which is bare project you need to create apk file using below command for Android

./gradlew assembleDebug   // apk file for debugging
./gradlew assembleRelease   // apk file production for preview purpose
./gradlew bundleRelease // aab file for production to upload on Play Store

Note: you need to copy all the file on your mobile or emulator to test it

Reference :

https://docs.expo.dev/

https://developer.android.com/build/building-cmdline

bagi2info.com
  • 408
  • 1
  • 3
  • 11
  • I want to run the application not for testing, for testing I run it using the "npx expo start --tunnel" command, other methods do not work for me. But now I want to install the finished application on my phone without publishing it on Google Play. – Игорь Мешалкин May 22 '23 at 11:13
  • Create using eas build – bagi2info.com May 22 '23 at 12:56
  • It seems I have already done this and got the AAB file. But this file does not run on my Android device. – Игорь Мешалкин May 23 '23 at 11:06
  • Build for apk use this command eas build -p android --profile preview, you can build aab, apk preview, apk development type using eas build – bagi2info.com May 23 '23 at 11:29
  • Thank you very much. Finally I managed to publish my application thanks to you. I have one more question. After the first publication, I decided to make corrections and publish again. But with each new publication, I get the same application as the first time. – Игорь Мешалкин Jun 17 '23 at 13:14
  • Change your app version and build number, upload it on production on google dev console, play store will share only the newest version – bagi2info.com Jun 17 '23 at 15:21