Title: Creating Android and iOS app from react-native
Tags: react-native
Question: 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
Comment: @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.

Comment: 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.

Comment: 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.

Here is the accepted answer: 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?
Comment for this answer: Is there anything related to debug and release build ?
Comment for this answer: 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...
Comment for this answer: This might help, https://forums.expo.io/t/create-a-debug-apk-instead-of-signed-apk-using-exp-interface/10247
Comment for this answer: 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.
Comment for this answer: Run expo build:android to build the .apk


{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 3, 'ContentLicense': 'CC BY-SA 4.0', 'CreationDate': '2019:00:02/05/19', 'FavoriteCount': 1.0, 'PostTypeId': 1, 'Tags': '<react-native>', 'Title': 'Creating Android and iOS app from react-native', 'ViewCount': 188, 'id': 54528921, 'user_AboutMe': '<p>Android/java developer having 7+ experience. Love programming. So i am here in this great SO site. Started blog : <a href="https://programmingalltheway.wordpress.com/" rel="nofollow noreferrer">https://programmingalltheway.wordpress.com/</a>. Request to follow if someone wants.</p>\n', 'user_AccountId': 460525.0, 'user_DisplayName': 'Android Killer', 'user_Reputation': 17897.0, 'user_Views': 3534.0, 'user_id': 861679.0}}