First, and you do this just once, create a keystore
"%JAVA_HOME%/bin/keytool" -genkey -v -keystore mykeystore.keystore
-alias mykeystore -keyalg RSA -validity 10000
Answer all the questions about your name, organization and location
Then build your apk and sign it like this
"%JAVA_HOME%/bin/jarsigner" -verbose
-keystore mykeystore.keystore MyAndroidApp.apk mykeystore
You'll be asked for the password you first supplied each time.
you can then install your app on the Android emulator
adb install "<path_to>MyAndroidApp.apk"