Automate ionic Android build with Teamcity

Recently I worked on  cross-platform mobile ionic project. I automated the whole build process using Teamcity. I am sharing the details here that might help other folks:

Build Step 1: Remove Artifacts

rm -rf *.apk

Build Step 2: Install bower components

bower install –allow-root

Build Step 3: Add platform

ionic platform add android

Build Step 4: Generate resources

ionic resources –splash
ionic resources –icon

Build Step 5: ionic build for ios

ionic build android

Build Step 6: Build unsigned apk

cordova build –release android

Build Step 7: Sign apk with keys

jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore android-release-key.keystore -storepass click123 ./platforms/android/build/outputs/apk/android-release-unsigned.apk alias_name

Build Step 8: ZipAlign

/var/www/teamcity/android-sdk-linux/build-tools/22.0.1/zipalign  -v 4 ./platforms/android/build/outputs/apk/android-release-unsigned.apk android-release-signed.apk

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s