'The term alias is not recognized

While trying to get the debug certificate fingerprint to be used in firebase we got an error claiming that keytool is not recognized, but we downloaded jdk and set the path then this error appeared:

-alias : The term '-alias' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of
the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ -alias androiddebugkey -keystore %USERPROFILE%\.android\debug.keystor ...
+ ~~~~~~
    + CategoryInfo          : ObjectNotFound: (-alias:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException


Solution 1:[1]

You should use this command, it will work!

keytool -list -v -alias androiddebugkey -keystore "%USERPROFILE%/.android/debug.keystore"

Password will be: android

Solution 2:[2]

keytool -list -v -keystore %USERPROFILE%.android\debug.keystore -alias androiddebugkey -storepass android -keypass android

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Yeasin Sheikh
Solution 2 Funny club