How can I generate an apk to test my app in native react

1

I have a project done with react-native and I've been testing it with expo, but I want to generate an apk to be able to see it on a device but I do not know how to do it, the react documentation is not very clear since it only explains how generate an apk ready to show to the play store and for now I only want one in debug version to make tests

    
asked by Leandro Villalobos 05.12.2017 в 15:58
source

2 answers

1

This explains how it works to generate an APK using Expo and the reference is the official guide of expo

The first thing is to install the exp tool doing:

npm install -g exp

Then configure your app.json file

{
  "expo": {
  "name": "Your App Name",
  "icon": "./path/to/your/app-icon.png",
  "version": "1.0.0",
  "slug": "your-app-slug",
  "sdkVersion": "17.0.0",
  "ios": {
    "bundleIdentifier": "com.yourcompany.yourappname"
  },
  "android": {
    "package": "com.yourcompany.yourappname"
  }
}
} 

You run the following command to test your project

exp start

If everything went well, now you execute the following command

exp build:android

At this point I will ask you if you have any keystore ready to generate your APK. If you have no idea what a keystore is, then choose Expo to manage the keystore for you.

After determining which keystore to use, you will generate an APK with the Expo infrastructure and it should take approximately 10 minutes You can monitor your creation with the following command:

exp build:status

When you are ready, you will receive a link that will direct you to your APK download. This APK is now a release and you can use it to test on your devices even if you do not have an account in the Google Play Store.

    
answered by 06.12.2017 / 03:08
source
0
  • You can run the app directly on your device by activating the USB Debugger mode and connecting it to your machine. Close all emulators and verify in a terminal if it appears in the list with adb devices .

  • You can check inside your project if in the directory
    android / build / outputs / apk / the app-debug.apk is generated, you can
    import it to the device and install it.

answered by 02.04.2018 в 18:00