This requires the latest version of apktool.
apktool d $APK_PATH -o $OUTPUT_FOLDER
# Open the apktool.yml text file
# Alter the versionCode and versionName entries
# now rebuild!
apktool build $OUTPUT_FOLDER
# next you need to re-sign the apk with the original keystore file
jarsigner -verbose -keystore $KEYSTORE_PATH -storepass $KEYSTORE_PASSWORD -keypass $KEYSTORE_KEY_PASSWORD $APK_PATH $KEYSTORE_KEY_NAME
~/android-sdk/build-tools/21.1.1/zipalign -v 4 $APK_PATH $APK_OUT_PATH
Hi' i've followed your steps but i can not get the updated generated apk, i mean, the last step i've got is rebuilding the apk:
C:\Users\APKTOOL>apktool build C:\APKTOOL\updatedversioncode
I: Using Apktool 2.2.2
I: Checking whether sources has changed...
I: Checking whether resources has changed...
I: Building apk file...
I: Copying unknown files/dir...
And no more...
EDIT:
I've figured out that the apk is in /dist folder and in addition i can specify a new output path using -o,--output