One of the points of Expo on top of React Native is that you don't go down to android or ios code. Expo deals with those folders for you, you don't need to interact with them. Is there a reason you need those folders? if so, you will have to eject. Here's the documentation to do so: Ejecting with ExpoKit
Answer from Funk Soul Ninja on Stack OverflowOne of the points of Expo on top of React Native is that you don't go down to android or ios code. Expo deals with those folders for you, you don't need to interact with them. Is there a reason you need those folders? if so, you will have to eject. Here's the documentation to do so: Ejecting with ExpoKit
Check this Expo document Adding custom native code
In general,
- to generate ios folder:
npx expo run:ios - to generate android folder:
npx expo run:android
After ejecting i can see the Android folder but not ios, can you help please?
With the current Expo SDK 50, using npx expo prebuild is the right starting point. After you did this, you need to build your project without relying on the metro server. This means, you have to build a standalone .ipa file for ios. You can do all of the following in Xcode by opening your ios/*.xcworkspace file.
- Change the Build Configuration: In Xcode -> Product -> Scheme -> Edit Scheme -> choose "Debug" -> Close
- Build the app: Product -> Build
- Archive your app: if there are no building errors -> Product -> Archive
- Export archived app: Window -> Organiser (this should open up automatically after step 3) -> select the archived build -> Distribute App -> Debug -> Perform signing procedure -> Select destination for .ipa file
- Install app on connected device: Connect device to your Mac -> Window -> Devices and Simulators -> Under "Installed Apps", click on "+" -> Select .ipa file
If you want to run your Expo app on your physical device without using the Expo Go app and an Expo server, you would need to create a standalone app binary (an IPA file for iOS).
This process involves "ejecting" from the managed Expo workflow to gain more control over the build process. Here's the general process:
Run expo eject in your project directory. This will create native iOS and Android project directories and configuration files.
For iOS, you'll now have an ios folder in your project directory. You can open this in Xcode by navigating to the directory and opening the .xcworkspace file.
From Xcode, you can run your app on a connected device by selecting the device from the target device list and clicking the "play" button.
Please note: In order to install the app on a physical device, you'll still need an Apple Developer account, even if it's just the free version. You'll have to sign your app with a development certificate. The app will also only run as long as the development certificate is valid, which is typically 7 days for a free Apple Developer account. After this period, you'll need to re-sign and re-install the app.
If you're looking for a way to run your app on your physical device indefinitely without an Apple Developer account, unfortunately, this is not possible due to Apple's policies.
I would like if someone who has more experience with Expo and development builds to try and answer the following questions.
If i wanna use a package that contains native code like react-native-date-picker i need to create a development build to use that package.
Currently we can do that in the following ways:
Use expo servers to build the development build with expo build --platform android. This will push the code to expo servers and create us a build which we download on phone and then we can start app with expo start and scan the QR code and our app will work.
Use expo build --local which will do the same as above but will not use expo servers but our local android studio to build development build.
Use npx expo run:android which will call expo prebuild and then again use our local setup to build development build. We then start our app with expo start.
My question is why does the last step 3. generate native project android and the 1. and 2. step don't?
Is it ok to delete that folder as i think we don' need it after the build is created?
I see this mentioned on expo docs:
Running
npx expo prebuild
again layers the changes on top of existing files. It may also produce different results after the build
To avoid this, add native directories to the project's .gitignore and use
npx expo prebuild --clean
command. This ensures that the project is always managed, and the
--clean
flag will delete existing directories before regenerating them. You can use app config or create a config plugin to modify your project's configuration or code inside the native directories.
Are these plugins only necessary when the package installation says to modify AndroidManifest or gradle files in native android folder?
I'm trying to follow what I thought would be a straightforward local workflow:
Start the Expo dev server with
expo startDevelop the app on the iOS simulator
Once ready, open the Xcode project, build, and run it on the simulator
Unfortunately, step 3 fails because the app expects the Expo dev server (Metro) to be running to fetch the JS bundle. This seems like a hard requirement.
I suppose you could manually tweak the Xcode project to load the bundle as a local resource, but that feels counterintuitive and messy.
Also, eas build --local still requires both Expo build tools and an Apple developer account, so it's not a pure local solution either.
Am I missing something obvious here, or is this just how it works with Expo right now? Any tips or clarification would be appreciated — thanks!
EDIT:
When I say step 3 fails, I meant that is running the expo dashboard which requires the dev server to run. I just want to run it without the server i.e. as the production build.