First of all, you must be running Android ant. Then, you must run:
ant release
This will compile the APK, but if you also want to sign it, run:
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore pathtokeystore.keystore pathtounsignedapp.apk alias_name
It will require passwords for the keystore and key. The unsigned apk will be signed in place, and you can just return the apk.