How to generate Key Hash for facebook SDK In Mac
I used following steps to generate a Key Hash for my app in facebook: (I am using Mac OSX 10.8)
- First open a terminal (open a command prompt in windows).
- Navigate in the terminal to the directory where your Android debug.keystore is stored.
- Mostly it will located under “/Users/user_name/.android/” (In Windows will be C:\Documents and Settings\.android).
-
Once you are in the “.android” directory, run the following command.
keytool -exportcert -alias androiddebugkey -keystore debug.keystore | openssl sha1 -binary | openssl base64
When it prompts you for a password, type android and hit Enter
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
Please follow below steps to find debug.keystore and generate key hash for android development at mac.
Open terminal
Type cd ~/.android and hit enter to go to .android directory
If you want to open .android directory in finder, type open . and hit enter. Then .android directory will be opened in finder where you can find debug.keystore. If you do not want to open .android directory and only want to generate key hash, then skip this point and follow #4.
-
In terminal where you are already in .android directory type
keytool -exportcert -alias alias_name -keystore sample_keystore.keystore | openssl sha1 -binary | openssl base64
and hit enter.
You are asked for password. Enter android as password and hit enter. Then you get key hash ending with "="
Copy key hash,enter in your facebook app setting page and save changes.