“别名”:术语“-别名”;未被识别为 cmdlet 的名称”错误

发布于 2025-01-12 12:15:09 字数 2051 浏览 4 评论 0原文

我需要在 firebase 中“调试签名证书 SHA-1”指纹。

但在命令行部分

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

当我运行此代码时,我收到如下错误:

C:\Users\Win10\Desktop\firebasse> keytool -list -v \
    >> -alias androiddebugkey -keystore %USERPROFILE%\.android\debug.keystore
    Illegal option:  \
    keytool -list [OPTION]...
    
    Lists entries in a keystore
    
    Options:
    
     -rfc                    output in RFC style
     -alias <alias>          alias name of the entry to process
     -keystore <keystore>    keystore name
     -cacerts                access the cacerts keystore
     -storepass <arg>        keystore password
     -storetype <type>       keystore type
     -providername <name>    provider name
     -addprovider <name>     add security provider by name (e.g. SunPKCS11)
       [-providerarg <arg>]    configure argument for -addprovider
     -providerclass <class>  add security provider by fully-qualified class name
       [-providerarg <arg>]    configure argument for -providerclass
     -providerpath <list>    provider classpath
     -v                      verbose output
     -protected              password through protected mechanism
    
    Use "keytool -?, -h, or --help" for this help message
    -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:2 char:1
    + -alias androiddebugkey -keystore %USERPROFILE%\.android\debug.keystor ...
    + ~~~~~~
        + CategoryInfo          : ObjectNotFound: (-alias:String) [], CommandNotFoundException
        + FullyQualifiedErrorId : CommandNotFoundException

在此处输入图像描述

有人可以帮忙解决吗?

I need "Debug signing certificate SHA-1" fingerprint in firebase.

But in commandline part

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

When I run this code I get an error like this:

C:\Users\Win10\Desktop\firebasse> keytool -list -v \
    >> -alias androiddebugkey -keystore %USERPROFILE%\.android\debug.keystore
    Illegal option:  \
    keytool -list [OPTION]...
    
    Lists entries in a keystore
    
    Options:
    
     -rfc                    output in RFC style
     -alias <alias>          alias name of the entry to process
     -keystore <keystore>    keystore name
     -cacerts                access the cacerts keystore
     -storepass <arg>        keystore password
     -storetype <type>       keystore type
     -providername <name>    provider name
     -addprovider <name>     add security provider by name (e.g. SunPKCS11)
       [-providerarg <arg>]    configure argument for -addprovider
     -providerclass <class>  add security provider by fully-qualified class name
       [-providerarg <arg>]    configure argument for -providerclass
     -providerpath <list>    provider classpath
     -v                      verbose output
     -protected              password through protected mechanism
    
    Use "keytool -?, -h, or --help" for this help message
    -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:2 char:1
    + -alias androiddebugkey -keystore %USERPROFILE%\.android\debug.keystor ...
    + ~~~~~~
        + CategoryInfo          : ObjectNotFound: (-alias:String) [], CommandNotFoundException
        + FullyQualifiedErrorId : CommandNotFoundException

enter image description here

Can anyone help with a solution?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

缱倦旧时光 2025-01-19 12:15:09

您的命令行部分适用于 Unix(或 Linux)shell,其中 \ 是转义字符。在 PowerShell 上,转义字符是 `,所以

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

应该可以解决问题。您还可以将所有内容放在一行中:

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

Your command line part is for a Unix (or Linux) shell where \ is the escape character. On PowerShell the escape character is `, so

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

should do the trick. You can also put everything in one line:

keytool -list -v -alias androiddebugkey -keystore %USERPROFILE%\.android\debug.keystore
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文