Signing Your Application

We're almost ready to sign your application, but first you need to create an unsigned version that you can sign with your signature certificate. To do that, in the Package Explorer window of Eclipse, right-click on your project name. You'll get a long popup menu; toward the bottom, click on Android Tools. You should see another menu that includes the item you want: "Export Unsigned Application Package...". This item takes you to a File Save dialog box, where you can pick the place to save the unsigned version of your apk file. It doesn't matter where you put it—just pick a place you can remember.

Now that you have an unsigned version of your apk file, we can go ahead and sign it using jarsigner. Open a terminal or command window in the directory where you stored the unsigned apk file. Here's the line we used to sign MJAndroid, using the key we generated earlier in the keystore microjobs.keystore:

$ jarsigner -verbose -keystore microjobs.keystore MJAndroid.apk mjkey

Congratulations! You now have a signed version of your application that can be loaded and run on any Android device. But before you send it in to Android Market, there's one more intervening step

0 0

Post a comment