Search code examples
androidmacoskeytool

not able to locate keytool on my mac to sign my apk file


I've used phonegap Build to create my .apk file and i'm trying to sign it.

I understand that I can do this with the following command:

$ keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -validity 10000

But when I run this in terminal I get 'command not found' ?

I'm running this on a mac so from what I've read I have the required JDK installed ( I have xcode ) I guess it might be that the PATH is not set correctly to keytool, but I'm unable to find any simple info on resetting this.

Any help would be hugely appreciated. I must be missing something very simple as it can not be this difficult to sign the app ?!?!


Solution

  • Make sure you have cd'd into the android-sdk/platform-tools directory (where the keytool will [most likely] reside). The command won't be found if you aren't in the keytool-containing directory.