React native takes a very long time to boot a device

I have been developing a simulator response app for a while. On the simulator (iOS), the application loads very quickly (for example, upon reboot). However, when I tried to download the application to the device, it spends 3 to 3 minutes in the splash screen before downloading to the application.

My project is quite small and has no additional resources besides javascript. If you look at the documentation, I can’t find the cause of the problem, although I suspect that it is due to the fact that it does not receive JS from the local server of the packer.

What am I doing wrong?

(btw - response-native v0.31)

+7
react-native
source share
1 answer

I ran into the same problem and found that this was due to the fact that I was running my application on the device in development mode. To get the performance you are looking for, you will need to create and run the application in production or release mode. You can do this by passing the --configuration parameter and setting it to Release using the React Native CLI :

$ react-native run-ios --configuration Release

If this does not do the trick, you may need to create your application in "Release" mode from Xcode. To do this, go to the /ios projects directory and open the .xcodeproj file in Xcode. Select an assembly target in the toolbar. Scroll down the page and select "Edit Schema ..." . Then, in Build Configuration, switch from "Debug" to "Release . " Now create the application on the target device, and it should be much more efficient than before.

You can read more in the official React Native documentation at Work on Device: Creating an Production Application .

+3
source share

All Articles