新 Android Studio 中的 Apk 位置 [英] Apk location in New Android Studio

查看:25
本文介绍了新 Android Studio 中的 Apk 位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始使用新的 Android Studio,在 IDE 中找不到应用程序的 APK,它实际位于何处?

I started using new Android Studio and cant find the APK of the application in IDE,where it actually locates?

推荐答案

为了帮助可能寻找同一问题答案的人,了解您在 Studio 中使用的项目类型非常重要.

To help people who might search for answer to this same question, it is important to know what type of projects you are using in Studio.

Gradle

新建项目时默认的项目类型,一般推荐的项目类型是Gradle.

The default project type when creating new project, and the recommended one in general is Gradle.

对于一个名为Foo"的新项目,主文件夹下的结构将是

For a new project called "Foo", the structure under the main folder will be

Foo/
    settings.gradle
    Foo/
        build.gradle
        build/

其中内部Foo"文件夹是主模块(此结构允许您稍后在同一结构中创建更多模块而无需更改).

Where the internal "Foo" folder is the main module (this structure allows you to create more modules later on in the same structure without changes).

在这个设置中,生成的APK的位置将在

In this setup, the location of the generated APK will be under

Foo/Foo/build/apk/...

注意每个模块都可以产生自己的输出,所以真正的输出更多

Note that each module can generate its own output, so the true output is more

Foo/*/build/apk/...

编辑在最新版本的 Android Studio 位置路径上生成的输出是

EDIT On the newest version of the Android Studio location path for generated output is

Foo/*/build/outputs/apk/...

IntelliJ

如果您在切换到 Studio 之前是 IntelliJ 的用户,并且直接导入您的 IntelliJ 项目,则没有任何改变.输出的位置将在以下情况下相同:

If you are a user of IntelliJ before switching to Studio, and are importing your IntelliJ project directly, then nothing changed. The location of the output will be the same under:

out/production/...

注意:有时会在 1.0 左右被弃用

Note: this is will become deprecated sometimes around 1.0

日蚀

如果您是直接导入 Android Eclipse 项目,请勿这样做!一旦您的项目(jar 或库项目)中有依赖项,这将不起作用并且您的项目将无法正确设置.如果您没有依赖项,那么 apk 将位于与您在 Eclipse 中找到的位置相同的位置:

If you are importing Android Eclipse project directly, do not do this! As soon as you have dependencies in your project (jars or Library Projects), this will not work and your project will not be properly setup. If you have no dependencies, then the apk would be under the same location as you'd find it in Eclipse:

bin/...

然而,这样做的重要性再怎么强调也不为过.

However I cannot stress enough the importance of not doing this.

这篇关于新 Android Studio 中的 Apk 位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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