Skip to content

Instantly share code, notes, and snippets.

@matteocollina
Last active April 4, 2018 14:05
Show Gist options
  • Save matteocollina/ee92ee698ddfefceb8ce85c9d94d69df to your computer and use it in GitHub Desktop.
Save matteocollina/ee92ee698ddfefceb8ce85c9d94d69df to your computer and use it in GitHub Desktop.
This is the script to export the .jsbundle and import to Main Bundle of the app. It's necessary when you want to deploy an iOS with integrated React Native app on AppStore/TestFlight
# If on Release, must export js bundle to run
if [ "$CONFIGURATION" == "Debug" ]; then
echo "Debug Configuration"
else
echo "Release Configuration"
# in my project "js/node_modules"
cd js
# Create a new .jsbundle
react-native bundle --platform ios --dev false --entry-file index.ios.js --bundle-output main.jsbundle
RESOURCE_PATH=$SRCROOT/js
FILENAME_IN_BUNDLE=main.jsbundle
BUILD_APP_DIR=${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app
cp $RESOURCE_PATH/$FILENAME_IN_BUNDLE $BUILD_APP_DIR/$FILENAME_IN_BUNDLE
echo "Copied jsbundle √"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment