Skip to content

Instantly share code, notes, and snippets.

@michelmelo
Created March 28, 2014 09:21
Show Gist options
  • Save michelmelo/9828705 to your computer and use it in GitHub Desktop.
Save michelmelo/9828705 to your computer and use it in GitHub Desktop.
#init
MOBILE_SDK=/Library/Application\ Support/Titanium/mobilesdk/osx/2.1.0.GA
ANDROID_SDK=/Users/ttp/Documents/Development/android-sdk-mac_x86
mkdir temp
mkdir dist
rm -r temp/*
rm -r dist/*
#copy apk
cp build/android/bin/app.apk .
unzip -o -d temp/ app.apk
#remove some things - you may want to remove other cruft
rm -rf temp/lib/armeabi
rm -rf temp/lib/x86
#zip it
cd temp
zip -r ../dist/app-unsigned.apk *
cd ..
#sign
jarsigner -sigalg MD5withRSA -digestalg SHA1 -storepass tirocks -keystore "$MOBILE_SDK/android/dev_keystore" -signedjar dist/app.apk dist/app-unsigned.apk tidev
$ANDROID_SDK/tools/zipalign -v 4 dist/app.apk dist/app.apkz
mv dist/app.apkz dist/app.apk
#install
$ANDROID_SDK/platform-tools/adb -d install -r dist/app.apk
#size
ls -lah dist/app.apk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment