本文介绍了在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.key
    }
}

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

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

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

09-03 11:14