Expo prebuild is a feature provided to improve the performance and reliability of the React native application.
I’m developing an Android application. When I tried to change the icon and splash screen, changes were not reflected after building the Android and iOS apps. I created a build multiple times but had no luck. Bizarre!
Then I prebuilt the expo project and built the application. Surprisingly all the changes were reflected and working smooth as expected. Android and iOS app icon was changed. The splash screen background color and image were working.
The prebuild feature is used to create native iOS and Android project files for building natively.
When you run the expo prebuild command, it compiles some of the basic JavaScriopt and assets files and stores them in the
Here is the expo prebuild command.
npx expo prebuild
There are several options available for prebuild command. Run the below command to get the last of the prebuild options you can pass as command parameters.
npx expo prebuild -h
It is always good practice, to run the prebuild command before creating the final project build. Make sure, you don’t have any changes in the files present in the
ios folder. Otherwise, it will overwrite those files and you may lose your changes.
Note: Expo also executes the prebuild command but it ignores it if the
ios folder is present in the project directory. If you want your application to prebuild the files when you run the expo build, delete
ios folder. Files in this folder will be created again.
If you have any doubt, write to me in the comment section below.