Unable to get SHA fingerprints outputs using keytool command

#1

I referred this section in Expo documentation to get Google API and OAuth Client ID for my standalone app. But I’m unable to generate the “SHA-1 certificate fingerprint” or the “Signing-certificate fingerprint” output when I run

// for Google API
keytool -list -printcert -jarfile <apk_name>.apk | grep SHA1 | awk '{ print $2 }'

// for OAuth Client ID
keytool -list -printcert -jarfile <apk_name>.apk | grep SHA1 | awk '{ print $2 }'

I get no output when I run the above 2 commands in my terminal.

  1. Do we need to go into Java/jdkX.X.X/bin folder to run this command?
  2. Should I use absolute path for apk? eg ~/Users/Desktop/<apk_name>.apk?

I am able to generate a ‘Android Debug KeystoreSHA1 Fingerprint’ using instructions on this page, but I’m not sure if this’ll work with my app.

Please advise.

#2

When you say “no output” is there an error or the command just does nothing? Yes, you should be using the keytool command from jdk/bin

#3

By “no output”, i mean the command just does nothing. There is no info or warning or error on the terminal. I can start typing my next command. Shouldnt it print out an SHA fi gerprint or something? I was running this from my desktop, tho.

So if i run the keytool command from jdk/bin folder, and my apk is on the desktop, ill have to give the actual path to the apk, right (~/username/desktop/apk_name.apk)? Or ill simply copy the apk in the jdk/bin folder and give it a shot.

I’ll check this out in a bit.

#4

@jesse Works! I moved the apk into the jdk/bin folder and ran the keytool command from there. I see the SHA output now. Thanks for helping out!

closed #5

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.