Skip to content

Instantly share code, notes, and snippets.

@phannam1412
Created March 19, 2018 09:16
Show Gist options
  • Save phannam1412/141a09a31d81b2e1562f77268fe6e8c8 to your computer and use it in GitHub Desktop.
Save phannam1412/141a09a31d81b2e1562f77268fe6e8c8 to your computer and use it in GitHub Desktop.
React Native - Auto build and upload apk to your server
#!/usr/bin/env bash
react-native bundle --dev false --platform android --entry-file index.android.js --bundle-output ./android/app/src/main/assets/index.android.bundle --assets-dest ./android/app/src/main/res/
cd android
./gradlew assembleDebug
cd ..
cp android/app/build/outputs/apk/debug/app-debug.apk app-debug.apk
# FTP upload file
HOST='your-host.com'
USER='your-username'
PASSWD='your-password'
ftp -n -v $HOST << EOT
ascii
user $USER $PASSWD
prompt
cd your-destination-directory-on-server
put app-debug.apk
ls -la
bye
EOT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment