Since you’re using Expo with React Native, the recommended way to build an Android APK by command line is using EAS Build (Expo Application Services). Here’s the complete step-by-step guide:
✅ Step-by-Step: Build Android APK with Expo via CLI
🧰 Prerequisites
-
Node.js installed
-
Expo project already created
-
Expo CLI installed (
npx expo) -
EAS CLI installed
✅ Step 1: Install EAS CLI (if not already installed)
npm install -g eas-cli
✅ Step 2: Login to Expo
npx expo login
Login with your Expo account.
✅ Step 3: Configure EAS (first time only)
eas build:configure
This will create a eas.json file in your project root.
✅ Step 4: Build APK (for Android)
eas build --platform android --profile preview