在 Android Studio 中单击运行时如何部署已签名的 APK? [英] How can deploy signed APK when click Run in Android Studio?

查看:20
本文介绍了在 Android Studio 中单击运行时如何部署已签名的 APK?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个使用 Google API 的应用.我已经在Google Developers Console"上创建了凭据.如果我创建了一个签名的 APK,并在手机上运行它,就没有问题.

I am developing an app which uses Google APIs. I have created credentials at "Google Developers Console". If I creates a signed APK, and run it on the phone, there is no problem.

问题是,在我开发应用程序时,当我单击运行"按钮时,它会在手机上部署该应用程序的未签名版本.因此该应用程序不起作用.

The problem is, while I developing the app, when I click RUN button, it deploys an unsigned version of the app on the phone. Thus the application does not work.

如何设置 Android Studio 使其在单击运行"按钮时在手机上部署已签名的 APK?

How can I set Android Studio to make it deploy signed APK on the phone when click RUN button?

推荐答案

将这些值添加到您的 .gradle:

Add these values to your .gradle:

signingConfigs{
    debug{
        keyAlias 'your key alias'
        keyPassword 'your keypassword'
        storeFile file('keystore path')
        storePassword 'your storepassword'
    }
}
buildTypes {
    debug{
        signingConfig signingConfigs.debug
    }
}  

文件中的密钥库路径类似于E:/xxx/xxx/xx.keystore.

The keystore path in the file will be something like E:/xxx/xxx/xx.keystore.

这篇关于在 Android Studio 中单击运行时如何部署已签名的 APK?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆