Skip to content

Instantly share code, notes, and snippets.

@easternHong
Created June 24, 2015 06:25
Show Gist options
  • Select an option

  • Save easternHong/956ffcb7f72eb4f72917 to your computer and use it in GitHub Desktop.

Select an option

Save easternHong/956ffcb7f72eb4f72917 to your computer and use it in GitHub Desktop.
ubuntu shell
#!/bin/bash
cd /home/hunt/AndroidStudioProjects/EFamily/EFamily
branch=''
printf "please input branch :"
read branch
git co ${branch}
#echo ${branch}
time=`date +"%02m%d%H"`
build=`date +"%m%d%H"`
versionCode="$time"
echo ${versionCode}
versionName="${branch}.${build}"
echo ${versionName}
#clean
gradle clean
# get build command
BUILD_CMD="gradle assemble\
-PversionCode=${versionCode} \
-PversionName=${versionName} \
-x lint"
#run gradle build ....
$BUILD_CMD
cp app/build/outputs/apk/app-release-unsigned.apk cert/app-release-unsigned.apk
echo generating--
cd cert/
java -jar signapk.jar platform.x509.pem platform.pk8 app-release-unsigned.apk app-signed.apk
echo "uninstall com.cylan.efamily"
adb uninstall com.cylan.efamily
echo "install -r app-signed.apk"
adb install -r app-signed.apk
echo "start EFamily"
adb shell am start com.cylan.efamily/.ui.activities.main.EFamilyActivity
echo "finised clean"
rm -fr *.apk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment