React Native - Migrate from Expo to another way of starting app - set up emulators for andorid and ios - ios

I have smaller RN application made with expo (expo-cli) and it is really annoying starting app every time using expo. What I want is to migrate to another way of starting app on my phone and with hot-reloading (if it is possible). If not, how can I start it on emulators? What changes should I do on current code?
What came to my mind is to create new RN app using create-react-native-app and move code from current app. Then install android studio for android emulator and xcode for iOS emulator etc.
But I don't know exact steps how to migrate from expo and how to setup everything work in non-expo environment, how to set up emulators, how to start app on emulators etc. Can someone explain it in details please? Thanks.

If you run an Expo project on a real device rather than an emulator on your computer,
you can recognize it on the device using the expo start command through the Expo app.
However, you should be logged in with the same ID as the Expo-cli.
googleplay App // Appplay App
If you want to run Expo on an Android studio and xcode, you need to separate the project into a stand-alone app.
You can run expo eject <= you use Expokit

Related

Flutter Plugin - Example App - Only runs via Xcode, not by itself

I'm creating a flutter plugin and I just tried the example project that gets created by flutter it self. This example project is an app that shows the operation system and its version. If I start it from Xcode on my iPhone SE, it works fine.
But if I close the app and open it without Xcode, that means that I tipp on the app icon to launche it, like every normal app, it doesn't start correctly.
It is showing for not even a second a white screen, followed by a black screen and is closing the app right after this.
Why is it behaving like that?
Is it, because it is a debug version and needs Xcode?
How can I put my example app on my iPhone without needing a connection to Xcode to start it?
Thanks in advance!
Edit: Thanks to the answer of Răzvan Puiu below, i know now that this is because xCode puts the app as a debug version on my iPhone. This debug version can only run with xCode. After I tried it with a 'normal' app and not the example app of a plugin project, i even got this text shown if i tried to start the debug version without xCode:
So the solution is to run the app with:
flutter run --release
I believe it behaves like that because you don't have an Apple developer account. "Without enrolling in the Apple Developer Program, your app will only last for 7 days on your device. After that, you’ll have to re-deploy it to your device via Xcode. If you’re enrolled in the Apple Developer Program, you won’t have this inconvenience."
Yes
You can run flutter run --release and then select your physical device. However the app will remain on your phone for only 7 days unless you have the Apple dev account.

Xcode keeps building old/cached code on device

I am developing an iOS app with react native. When I run my app on a real iOS device via Xcode, code changes are not reflected anymore. It keeps building an old code version of my app. However, as soon as I run the app in the simulator, it uses the latest code. Unfortunately, cleaning the build folder, deleting ~/Library/Developer/Xcode/DerivedData/ and removing the old app from device did not help. Does anyone know a solution?

How to create a distributive react-native app for iOS?

I have created a react-native app using the tools - VS Code, expo, react-native.
I am able to run the app on expo client as well as xcode simulator easily on my laptop. What I want now is to make a distributive file for iOS like we have .apk for androids for this app.
I referred to this question How to build .ipa application for react-native-ios?
and tried
react-native run-ios --configuration=release
but I get an error:
Error iOS project folder not found. Are you sure this is a React Native project?
Don't know what I am missing here? I am a beginner with react-native, would really appreciate any help on this.
You have to run expo build:ios that will then ask you your account and certificates, once you have all that figured out it will give you a link where you can see how the build is doing, after it's complete you can download the .ipa file and use the app transporter from the app store to send you app to apple servers.
(All this if you are using expo, if you aren't it's a hole different conversation and a lot more difficult)

React Native iOS app different code on simulator vs ad hoc/App Store

I have been working on a React Native app for several weeks. I recently pushed a version to TestFlight. When I started getting feedback from users I noticed that their screenshots were different than the latest changes I made. They were from older revisions.
I ran the app in the iOS Simulator. I get the correct version of the code.
I ran the app on a device connected to my Mac. I get the correct version of the code.
I ran the app distributed ad hoc and I get an older version of the app.
I haven't seen anything like this before and baffled as to what could cause the problem.
I connected with Brent Vatne on Expo's Slack. I forgot to run expo publish before running the release build.

Steroids JS build app for XCode

I'm using AppGyver Steroids to create an app. I want to build an iOS build of it so that I can open the app in XCode. With regular PhoneGap I can simply run phonegap build. I do not see this in Steroids. I've run phonegap build in the Terminal, but it doesn't show native elements when I run it in the simulator (from XCode) like navigation bar.
Is this possible with Steroids? Thanks!
If you're planning to use Steroids, you need to use the Steroids Build Service. To create an actual build targeting iOS platforms, please consult their guide on how to do this.
If you just are developing, use the deploy command to get the QR code and scan it with the AppGyver scanner application to load it temporarily to your device. Or if you want to run it in the emulator, start a steroids session from the terminal:
steroids connect
then enter
simulator
once you're in the steroids session and that should start the iOS simulator.
Not sure what you'd need xCode for in this. The beauty of steroids is that there is no iOS specific code for you to maintain (before you start messing with PhoneGap plugins, which is a different ballgame.) You can still open your html pages using xCode if you wish.
If you're asking how to have xCode do this stuff for you, then I could be wrong but I do not think there is a way. I believe the simulator that Steroids starts is the same as the xCode simulator.

Resources