从 Android Studio 中的 Gradle 项目导出未签名的 apk [英] Export unsigned apk from a Gradle Project in Android Studio

查看:41
本文介绍了从 Android Studio 中的 Gradle 项目导出未签名的 apk的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通常使用 Eclipse 创建项目并将它们导入 Android Studio,因为我讨厌 AS 给我的项目结构.在它的模块设置中,我可以创建工件,允许我将构建的 apk 输出到某个路径.

I usually create projects with Eclipse and import them into Android Studio, because I hate the project structure AS gives me. In it´s module settings, I have the possibility to create artifacts which allow me to output the built apk to a certain path.

现在我直接用AS创建了一个Gradle项目,看起来这些项目的选择比eclipse项目少得多.我没有找到任何可以输出我的 apk 的东西,并且在构建后我的项目文件夹中也没有找到任何 apk.

Now I have created a Gradle project directly with AS and it seems that those projects have quite less options than eclipse projects. I don´t find anything to output my apk and I don´t find any apk inside my project folder after building.

如何让我的未签名 apk 退出构建过程??

How do I get my unsigned apk out of the build process??

推荐答案

使用

Build > Make Project

从 Android Studio 构建 apk 文件.

to build an apk file from Android Studio.

您可以在以下路径下获取未签名的 apk

You can get your unsigned apk under the below path

$YOUR_PROJECT/$YOUR_MODULE/build/apk

未签名的 apk 文件将在其名称中包含未签名"文本.

unsigned apk files will have "unsigned" text in their names.

[更新]:

在最近发布的 Android Studio 中,您不会在 sysncing 或 Make Project 上获得 apk 文件.还有另外两种方法可以获取apk文件

In Recent release of Android Studio you will not get apk file on sysncing or Make Project. There are two other methods in order to get the apk file

  1. 运行应用
  2. 从 Studio 窗口右侧的 Gradle 面板或从底部的嵌入式终端窗口(在项目根目录中)执行组装任务

gradlew assembleDebug(或您想要构建的任何构建变体)

gradlew assembleDebug(or whatever build varient you want a build for)

并且更新新的apk路径将是

and the update new apk path will be

$YOUR_PROJECT/$YOUR_MODULE/build/outputs/apk

这是由 Android 工具团队完成的,以提高 Android Studio 的性能.

This has been done by Android Tools team to improve the Android Studio performance.

这篇关于从 Android Studio 中的 Gradle 项目导出未签名的 apk的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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