React Native: Generate .apk and .ipa using Expo
Asked Answered
S

10

50

I'm trying to generate a .ipa and a .apk file for my React Native app using Expo & Create React Native App. I successfully built the app and was able to get it to run on both an iOS & an Android device thanks to the docs: https://docs.expo.io/versions/v16.0.0/guides/building-standalone-apps.html

When the build is over, my console shows something like

Your URL is https://exp.host/@myname/myapp

I then open exp.host/@myname/myapp on my device and the app shows up via the Expo client.

But at point 4 of the docs, it is said that

When it’s done, you’ll see the url of a .apk (Android) or .ipa (iOS) file — this is your app.

I'm a bit confused. No where in the process do I see any ipa or apk file generated anywhere on my pc. Am I missing something ? How do I actually generate the files ?

Subdebutante answered 1/6, 2017 at 7:47 Comment(1)
The docs link you have shared in the question isn't valid anymore. I need a bit of guidance to do the same thing for my app. Do you have the updated source for same instructions?Inconsonant
A
41

You will need to run expo build:status. When building process is complete you will see link to download apk (Android) or ipa(IOS) file.

Audriaaudrie answered 21/7, 2017 at 12:17 Comment(4)
Please ensure you have the exp command line tool installed: npm install -g expDistracted
In 2019, it's expo not exp . The link to the recent docs at this time of writing is expo-standalone-apps. According to the steps in the answer, you would need to run expo build:status rather than exp build:status and then after run expo build:android or expo build:ios depending on what OS you're building for. After running that you would be asked a couple of questions like if you want expo to handle everything, I'd suggest you do.Ceja
No currently active or previous builds for this project.Shiner
expo build:androidExteroceptor
A
49

make sure in app.json

{
  "expo": {
    "name": "your app name",
    "description": "your app desc",
    ....,
    "ios": {
      "supportsTablet": true
    },
    
    "android": {
      "package": "com.yourcompany.yourappname"
    }
  }
}

then run expo build:android or expo ba

after that

run expo build:status you'll find, something like this, the Apk's is hosted on amazon aws

[exp] Android:
[exp] APK: https://HOST/yourapp.apk
Audrey answered 3/10, 2017 at 9:33 Comment(3)
Do I always need to manually type to copy the url for downloading apk? I am getting the url even able to download apk file but the only question is to is there any way to access directly? I dont want to type everytime.Sparerib
@BilalHussain yes you have to copy the url manually to get the APKAudrey
You can use a url to get all the previous and current builds so you can monitor your builds in an easier way: https://mcmap.net/q/347539/-react-native-generate-apk-and-ipa-using-expoBattled
A
41

You will need to run expo build:status. When building process is complete you will see link to download apk (Android) or ipa(IOS) file.

Audriaaudrie answered 21/7, 2017 at 12:17 Comment(4)
Please ensure you have the exp command line tool installed: npm install -g expDistracted
In 2019, it's expo not exp . The link to the recent docs at this time of writing is expo-standalone-apps. According to the steps in the answer, you would need to run expo build:status rather than exp build:status and then after run expo build:android or expo build:ios depending on what OS you're building for. After running that you would be asked a couple of questions like if you want expo to handle everything, I'd suggest you do.Ceja
No currently active or previous builds for this project.Shiner
expo build:androidExteroceptor
C
8
  • use `expo build:android` for android
  • use `expo build:ios` for ios

it will ask to create new account if you don't have an expo account expo build:status to know status of your app & the queued app may take around 30 mins to generate apk file .
you can find it in expo website

how to generate apk/ios file from expo

Carte answered 14/2, 2020 at 6:4 Comment(0)
K
8

Update For the Latest Version of expo:
Expo will soon deprecate expo build and has encouraged using eas build, which builds to app bundle by default. To build to apk, modify the eas.json file accordingly as given here in expo docs. You will ofcourse have to install eas separately as it doesn't come bundled with expo-cli.

For apk add eas.json as:

{
  "build": {
    "preview": {
      "android": {
        "buildType": "apk"
      }
    },
    "preview2": {
      "android": {
        "gradleCommand": ":app:assembleRelease"
      }
    },
    "preview3": {
      "developmentClient": true
    },
    "production": {}
  }
}

and then run eas build -p android --profile preview

Kermis answered 18/6, 2022 at 9:58 Comment(0)
A
3

As per https://docs.expo.dev/classic/building-standalone-apps/: "The Classic Build service (expo build:{android,ios}) is in maintenance mode and has been superseded by EAS Build. SDK 46 will be the last SDK supported by Classic Builds and the Classic Build service will stop running for all SDK versions after January 4, 2023.", the new commands are:

  • eas build --platform android for Android
  • eas build --platform ios for iOS
  • eas build --platform all for both

More information: https://docs.expo.dev/build/setup/.

Anthropoid answered 8/5, 2022 at 19:46 Comment(0)
E
3

This command will work

eas build -p android --profile preview

Esqueda answered 18/9, 2022 at 14:25 Comment(0)
B
2

If you execute build status:

expo build:status

you will get the status update of the build either for ios or android. It will show one of these possible states:

  • Build in progress...
  • There was an error with this build
  • URL of the ipa or apk file

The URL would be something like:

https://expo.io/builds/{buildId}

where {buildId} is a UUID

When you click on the link, it will show the current status, logs being generated, a "Download" button where you can download the ipa or apk file (which will only be available if the build was successful) and a "Cancel" button to cancel the current build (which will only be available if the build is running).

Alternatively you can view your previous and current builds statuses by following this link:

https://expo.io/{@user}/{app}/builds

Replace {@user} with your expo username (including the @ character) and {app} with your app name. Here you can view specific build statuses like Completed or Failed, view logs of your builds, and download current and previous successful builds.

This URL is also shown when you go to your current build, below the "Build logs" title:

This is a build from {@user}/{app}

Battled answered 1/3, 2018 at 11:16 Comment(0)
M
0

At first, Run this command -> expo build:android then

login your expo account

Choose the build type you would like: apk:normal apk file apk-bundle: for play store and app store

then generate a keystore file and wait minimum 10 minutes then your get a build link https://expo.dev/accounts/your_account_name/projects/project_name/builds/6ab79fef-72fe-4f50-88e2

goto thik link and download your build.

Mahla answered 24/9, 2022 at 6:34 Comment(0)
E
0

if you're using the new Expo Application Services (EAS) to build your React Native app, you can use the following command to generate an IPA file for IOS:

eas build -p ios --profile preview

And if you are using the Android so you can use :

eas build -p android --profile preview
Evangelicalism answered 26/4, 2023 at 12:38 Comment(0)
S
0

expo build:android has been superseded by eas build.

(Learn more: https://blog.expo.dev/turtle-goes-out-to-sea-d334db2a6b60)

Run the following instead:

› npm install -g eas-cli
› eas build -p android 

ref - https://docs.expo.dev/build/setup/

Spoonful answered 3/1 at 20:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.