Q:

How to assign "Development Key Hash" for a device and not an emulator

login with Facebook
how can I assign a "Development Key Hash" to a android device? 
using KeyTools 
keytool -importkeystore -srckeystore path/to/keystore/with/forgotten/pw -destkeystore path/to/my/new/keystore

I sign only the application using the emulator and not device 
how can I fix it?

A:

You can get the key hash for that device with this snippet, just add the code in your MainActivity and check the Logcat.
try {
    PackageInfo info = getPackageManager().getPackageInfo(
            "com.facebook.samples.hellofacebook", 
            PackageManager.GET_SIGNATURES);
    for (Signature signature : info.signatures) {
        MessageDigest md = MessageDigest.getInstance("SHA");
        md.update(signature.toByteArray());
        Log.d("KeyHash:", Base64.encodeToString(md.digest(), Base64.DEFAULT));
    }
} catch (NameNotFoundException e) {

} catch (NoSuchAlgorithmException e) {

}

BR

