DEV Community

Aashish Karki
Aashish Karki

Posted on

Advantage of React Native Debug

One of the advantages of using react native is the use of dev mode build, the build access the js bundle from your local device.

In case of device being used in local network we can access the said bundle using a shake gesture and addressing the proper ip address and port i.e. usually 8081.

Say we have a project where you are working on a specific feature and would require another person to see the progress of the said feature, we can achieve this by hosting the js bundle across the internet. Note: if any module/library that uses native module is added we must have a updated build.

Firstly create a tmpDir folder in root then we generate the js bundle.

ios:

yarn react-native bundle --platform ios --dev false --entry-file index.js --bundle-output tmpDir/index.ios.bundle.js --assets-dest tmpDir
Enter fullscreen mode Exit fullscreen mode

android:

yarn react-native bundle --platform android --dev false --entry-file index.js --bundle-output tmpDir/index.bundle
Enter fullscreen mode Exit fullscreen mode

Now we host the said directory. And after that it is same as using a local network, shake and update the build access point. Android and iOS will auto detect the js bundle they require.

Top comments (0)