Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I specify location of debug keystore for Android ant debug builds?

Is it possible to specify the location of a self created debug keystore when creating debug .apk's (<project-name>-debug.apk) with ant debug? I only see the possibility to specify the location of the release keystore.

I would like to share the debug keystore over multiple PC's without copying them over the the one that is placed in the '.android' directory. The debug keystore could for example reside within the source code repository. But I need a way to tell ant where to find the debug keystore.

like image 890
Huupke Avatar asked Jan 26 '12 14:01

Huupke


People also ask

Where is the Android debug keystore?

The default keystore file: debug. keystore is present in the folder . android which is usually located in the default home folder of your operating system of the user who installed that Android SDK.

What is the debug keystore?

A debug keystore which is used to sign an Android app during development needs a specific alias and password combination as dictated by Google. To create a debug keystore, use: $ keytool -genkey -v -keystore debug.

How do I find my debug keystore password?

Usually the debug. keystore password is just "android". You can delete it and Eclipse will automatically generate a new one, as described here.


1 Answers

You should be able to specify the keystore to use with these properties

key.store=/path/to/key.keystore key.alias=alias key.store.password=pass key.alias.password=pass 

Just pass the properties in to Ant.

[EDIT] From the docs at http://developer.android.com/guide/publishing/app-signing.html#setup

The Android build tools provide a debug signing mode that makes it easier for you to develop and debug your application, while still meeting the Android system requirement for signing your .apk. When using debug mode to build your app, the SDK tools invoke Keytool to automatically create a debug keystore and key. This debug key is then used to automatically sign the .apk, so you do not need to sign the package with your own key.

The SDK tools create the debug keystore/key with predetermined names/passwords:

  • Keystore name: "debug.keystore"
  • Keystore password: "android"
  • Key alias: "androiddebugkey"
  • Key password: "android"
  • CN: "CN=Android Debug,O=Android,C=US"

If necessary, you can change the location/name of the debug keystore/key or supply a custom debug keystore/key to use. However, any custom debug keystore/key must use the same keystore/key names and passwords as the default debug key (as described above). (To do so in Eclipse/ADT, go to Windows > Preferences > Android > Build.)

like image 133
codemonkey Avatar answered Sep 23 '22 14:09

codemonkey