Last active
December 11, 2015 14:28
-
-
Save hugozap/4614108 to your computer and use it in GitHub Desktop.
Build and sign .apk and send it to ftp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Change to your android project path | |
SRCPATH="$HOME/Developer/src/android_project_path" | |
# Ftp settings | |
SERVER="ftp.example.com" | |
USER=YOUR_FTP_USER | |
PASS=YOUR_FTP_PASSWORD | |
REMOTEDIR="/" | |
# Change it to the .apk generated in the bin directory | |
Filename=MyProject-release.apk | |
# Build.xml path | |
BUILDFILE="$SRCPATH/build.xml" | |
# Path of the generated .apk file | |
APKFILE="$SRCPATH/bin/$Filename" | |
# Name of the file that will be uploaded ( i needed it to be different ) | |
TARGETFILE="$SRCPATH/bin/myproject_buil.apk" | |
# -------- Clean existing files -------- | |
echo "**Removing apks**" | |
rm -f $APKFILE | |
rm -f $TARGETFILE | |
echo "ant release" | |
ant -buildfile $BUILDFILE release | |
# ------- Rename file -------- | |
mv $APKFILE $TARGETFILE | |
# ------- Upload to ftp ----------- | |
echo "Uploading file to $SERVER" | |
ncftpput -m -u $USER -p $PASS $SERVER $REMOTEDIR $TARGETFILE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment