How to generate Key Hash for facebook SDK In Mac

ady picture ady · Jul 12, 2011 · Viewed 60.2k times · Source

I'm trying to obtain the key hash for integrating facebook into my Android app. But all over the net I can't find the way to do it on MAC OS X, only for Windows.

If someone could light me with the proper way to obtain the key hash I'd really appreciate it.

Thank you!

Answer

Arun G picture Arun G · Sep 25, 2012

I used following steps to generate a Key Hash for my app in facebook: (I am using Mac OSX 10.8)

  1. First open a terminal (open a command prompt in windows).
  2. Navigate in the terminal to the directory where your Android debug.keystore is stored.
  3. Mostly it will located under “/Users/user_name/.android/” (In Windows will be C:\Documents and Settings\.android).
  4. Once you are in the “.android” directory, run the following command.

    keytool -exportcert -alias androiddebugkey -keystore debug.keystore | openssl sha1 -binary | openssl base64

  5. When it prompts you for a password, type android and hit Enter

  6. Copy the value printed in the terminal that ends with an “=” and paste it in the Key Hash field in Facebook. Then click the Save Changes button.

Reference: Integrate Facebook logins in your Android app