Videos
react native - Expo How to create a development build for android and how to create a .apk file? - Stack Overflow
Difference between Development client, Development build, Expo go
If you are building a new app with Expo
How can I build and distribute an Expo (React Native) app without using EAS Build, while still supporting CI/CD and OTA testing for QA? : reactnative
I use EAS as well and i find it quite handy. Let me explain the profiles quickly.
All profiles can be found in
eas.json
Development
This type is for developing, it makes it possible to see live reloads, live changes in the application when you change it. You can even pass env. variables if needed.
eas build --profile development --platform android
OR
To make a local build so the Expo Application Service is skipped
npx expo run:android
"development": {
"developmentClient": true,
"distribution": "internal",
"env": {
"API_URL": "X",
}
Preview
This creates a .apk file that you can install on your device or emulator. Note the the env. variable does not need to be the same as development
eas build --profile preview --platform android
"preview": {
"distribution": "internal",
"env": {
"API_URL": "Y",
}
},
Production
This creates a .aab file which you can upload on to Google Developer Console, if you want to set your app on the app store.
eas build --profile production --platform android
"production": {
"env": {
"API_URL": "X",
}
},
If you do not need the env values, you can safely delete them.
After executing on of the commands in your terminal, a link should appear to expo.dev where you can download and install your development or preview .apk file
I use the EAS to create development builds and generate apk file. Reference my eas configuration to see the different profiles setup. At minimal, I have development, development-simulator and production build profiles defined.
{
"cli": {
"appVersionSource": "local"
},
"build": {
"development": {
"distribution": "internal",
"channel": "uat",
"developmentClient": true,
"env": {
"bundleIdentifier": "",
"name": "",
"APP_VARIANT": "development"
},
"autoIncrement": false,
"android": {
"buildType": "apk",
"gradleCommand": ":app:assembleDebug"
}
},
"development-simulator": {
"extends": "development",
"ios": {
"simulator": true
}
},
"production": {
"channel": "production",
"distribution": "store",
"developmentClient": false,
"autoIncrement": false,
"env": {
"bundleIdentifier": "",
"name": ""
},
"ios": {
"resourceClass": "m1-medium"
}
},
"internal": {
"extends": "production",
"channel": "production",
"distribution": "internal",
"developmentClient": false,
"autoIncrement": false,
"env": {
"bundleIdentifier": "",
"name": ""
}
},
"uat": {
"extends": "production",
"channel": "uat",
"distribution": "internal",
"developmentClient": false,
"autoIncrement": false,
"env": {
"bundleIdentifier": "",
"name": ""
}
}
}
}
For example, to create a build for Android simulator, run
npm run build:android:dev
The build may take up to a few minutes to complete depending on the queue.
After the build is complete, you can download it on your iOS device by scanning the QR code from the device's camera from the Expo CLI. You can also find this QR code on the build page in the expo dashboard.
With the development build installed on your device or emulator/simulator, start the development server with npm run start. The app will run on your device and you can make changes in javascript and see the changes immediately.
A rebuild of the development client is only necessary if you add a library to your project that contains native code APIs, for example, expo-secure-store.
TLDR; Drop Expo Go, Creat full build with expo-dev-client
If you are building a new app with Expo, the first step after initial setup should be to to create a dev client build. You can search the EAS docs for how to do that but it is a single command. I see many posts stating “x isn’t working with Expo Go”. With the modern Expo / EAS cli you shouldn’t really even need Expo Go at all if you if you are doing anything more than prototyping. Use the EAS cli to create a full build of your application with expo-dev-client which gives you all of the benefits of Expo Go (hot reload) with no downsides (package constraints etc…) for a “pro tip” use the —local option to build the application locally without needing to wait for the expo servers.