ReactNative app Local APK

Trevor (Al Rashid)
2 min readDec 13, 2022

--

Run your app on your phone.

Now that your application is running locally, you may want to publish it so that you can share it with friends so they can share it with you.

Add eas.json configuration file in the root project.

{
"cli": {
"version": ">= 3.5.2"
},
"build": {
"production": {
"releaseChannel": "production-v1",
"node": "16.14.0",
"env": {
"REACT_APP_API_URL": "https://backend-api.net/api"
}
},
"preview": {
"android": {
"buildType": "apk",
"developmentClient": true,
"gradleCommand": ":app:assembleRelease"
},
"ios": {
"simulator": true
},
"releaseChannel": "preview",
"extends": "production",
"distribution": "internal",
"env": {
"REACT_APP_API_URL": "https://backend-api.net/api"
}
}
}
}

In case your app uses react-native-maps, ensure you have added your GOOGLE_API_KEY for both platforms as below:

{
"expo": {
"name": "My Mobile App",
...
},
"ios": {
...
"bundleIdentifier": "com.company.app",
"config": {
"googleMapsApiKey": "xyz-is-the-key"
}
},
"android": {
...
"package": "com.company.app",
"config": {
"googleMaps": {
"apiKey": "xyz-is-the-key"
}
}
},
...
}
}
}

Install the eas-cli from npm:

$ npm install -g eas-cli

Build the apk:

$ eas build --profile preview --platform android

Confirm on your expo account web page under builds:

Download the apk, rename it and share it via any means as file.

The usual way of installing is followed.

--

--

Trevor (Al Rashid)

Cloud Engineer | Educator | Entrepreneur | Champion Innovator at Google Cloud Innovators 🎖️