简体   繁体   English

如何运行Android自定义构建类型?

[英]How do I run my Android custom build type?

So I am trying to get my project to generate a signed and aligned apk and run it on my phone all through the Android Studio IDE. 所以我试图让我的项目生成一个签名和对齐的apk,并通过Android Studio IDE在我的手机上运行它。

My build.gradle looks like this: 我的build.gradle看起来像这样:

signingConfigs {
    release {
        keyAlias 'key'
        keyPassword 'pwd'
        storeFile file('..\\m-release-key.keystore')
        storePassword 'pwd'
    }
}
buildTypes {
    release {
        debuggable false
        jniDebugBuild false
        signingConfig signingConfigs.release
        runProguard false
        zipAlign true
    }
}

The problem is that when I build, all that is getting produced is a debug-unaligned.apk, whether I click on Run or Debug, I get the same thing. 问题是,当我构建时,所有产生的都是debug-unaligned.apk,无论我点击Run还是Debug,我都会得到同样的东西。 I can't see any setting for this in Build Configurations either. 我在Build Configurations中也看不到任何设置。 How can I tell Android Studio to use my release build type? 如何告诉Android Studio使用我的发布版本类型? What am I missing? 我错过了什么?

Choose the release build variant from the Build Variants tool window, as shown: Build Variants工具窗口中选择发布版本变 ,如下所示:

IDE屏幕截图,显示Build Variants工具窗口

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何获取自定义帐户类型以显示在android联系人应用中? - How do I get my custom account type to show up in the android contacts app? 我如何在 android studio 中构建和运行我的应用程序 - How i can build and run my app in android studio 如何构建原生(命令行)可执行文件以在 Android 上运行? - How do I build a native (command line) executable to run on Android? 如何从 CLI 构建和运行 android 应用程序? - How do I build and run android app from CLI? 如何在Android(Fennec)自定义版本的Firefox中添加扩展程序? - How do I include extensions with a custom build of Firefox for Android (Fennec)? 如何在我的 Android 应用程序中运行打包的二进制文件? - How do I run my packaged binary in my Android app? 如何从Android版本中删除导航栏? - How do I remove the navigation bar from my Android build? 我如何为三星银河建立自己的机器人 - How do I build my own android for the samsung galaxy 如何向我的Android Ant构建系统添加类路径? - How do I add a classpath to a my Android Ant build system? 如何在后台运行我的服务并在Android中关闭BroadcastReceiver? - How do I run my serivice on background and close BroadcastReceiver in Android?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM