I have created one react-native app using expo and atom editor. It's running fine in android device and iOS simulator but with the help of expo. What I want is to generate Apk(debug) so that I can directly run on device. How can I do it ? I followed this(Dmitry Mugtasimov's answer). should I run all those command inside project folder ? Also I don't find index.js file inside my project folder. Also if someone know how to run on iOS simulator by creating app like file(don't know what is that in Ios because from android background). Please help, thanks
-
Yes, you should run those commands in the project folder (your react native app folder). And for iOS you can't create an ipa file and run it on iOS simulator as simulator doesn't support all the architecture. – Aaditya Paliwal Feb 05 '19 at 06:46
-
@AadityaPaliwal thanks for the reply, then how we do for iOS as it supposed to be cross platform project i.e. should run on both the platform. – Android Killer Feb 05 '19 at 06:49
-
You can follow this https://facebook.github.io/react-native/docs/running-on-device to running on device. you have to register your device in apple ID. – Aaditya Paliwal Feb 05 '19 at 06:58
1 Answers
Since you have used Expo to develop your react-native app you can build the android app by going to the project folder and running the bellow command in the terminal
expo build:android
The building process will take around 5-10 minutes. When your build is done, expo build:status
will give you your .apk file url. If not, it will say your build is still in progress and to try again later.
Also to build the iOS app you can run,
expo build:ios
To build the iOS standalone app you will need to have an Apple Developer account, but for Android standalone app you don't need a Google Play Developer account.
For the above commands to work you need to have expo-cli installed, For this you can run the bellow command,
npm install -g expo-cli
More Info: https://docs.expo.io/versions/latest/distribution/building-standalone-apps/
If you don't have an Apple Developer Account. You can build the iOS standalone simulator build using the command,
expo build:ios -t simulator
And then wait for build to finish then download and unpack YourAppName.tar.gz. Then, start the iOS simulator and run xcrun simctl install booted YourAppName.app
to run the .ica file.
More info: Expo / React-Native, Is it there a way to test-run standalone iOS apps on a device/simulator?

- 1,567
- 2
- 20
- 28
-
-
This might help, https://forums.expo.io/t/create-a-debug-apk-instead-of-signed-apk-using-exp-interface/10247 – Nadun Kulatunge Feb 05 '19 at 08:17
-
In expo while developing, you can run npm start to test the app. You will have to scan the QR code using the expo app or run the app on android or iOS simulator. – Nadun Kulatunge Feb 05 '19 at 08:23
-
That I already did and can run. I just wanted to run through creating apk. That actually run via expo app not directly like android native app. so... – Android Killer Feb 05 '19 at 08:25
-