热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

Apk定位在新的AndroidStudio-ApklocationinNewAndroidStudio

IstartedusingnewAndroidStudioandcantfindtheAPKoftheapplicationinIDE,whereitactually

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

我开始使用新的Android Studio,却无法在IDE中找到应用程序的APK。

28 个解决方案

#1


116  

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.

要帮助那些可能要寻找相同问题答案的人,重要的是要知道您在Studio中使用的是哪种类型的项目。

Gradle

Gradle

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

在创建新项目时,默认的项目类型是Gradle。

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

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

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

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).

内部的“Foo”文件夹是主模块(该结构允许您稍后在相同的结构中创建更多的模块,而无需更改)。

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

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

Foo/Foo/build/apk/...

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

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

Foo/*/build/apk/...

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

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

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

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:

如果您在切换到Studio之前是IntelliJ的用户,并且正在直接导入IntelliJ项目,那么没有什么变化。输出的位置如下:

out/production/...

Note: this is will become deprecated sometimes around 1.0

注意:在1.0版本左右,这将被弃用

Eclipse

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:

如果您正在直接导入Android Eclipse项目,请不要这样做!一旦您的项目(jar或库项目)中有了依赖项,这将无法工作,您的项目将无法正确地设置。如果您没有依赖项,那么apk将位于与Eclipse中相同的位置:

bin/...

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

然而,我不能强调不这样做的重要性。

#2


80  

I am on Android Studio 0.6 and the apk was generated in

我使用的是Android Studio 0.6, apk是在

MyApp/myapp/build/outputs/apk/myapp-debug.apk

It included all libraries so I could share it.

它包括了所有的库,所以我可以分享它。


Update on Android Studio 0.8.3 Beta. The apk is now in

Android Studio 0.8.3 Beta版的更新。apk现在在

MyApp/myapp/build/apk/myapp-debug.apk

Update on Android Studio 0.8.6 - 2.0. The apk is now in

更新Android Studio 0.8.6 - 2.0。apk现在在

MyApp/myapp/build/outputs/apk/myapp-debug.apk

#3


41  

There is really no reason to dig through paths; the IDE hands it to you (at least with version 1.5.1).

真的没有理由去挖掘道路;IDE将它交给您(至少是1.5.1版本)。

In the Build menu, select Build APK:

在Build菜单中,选择Build APK:

Android Studio Build Menu

A dialog will appear:

会出现一个对话框:

Android Studio APK Generated Dialog

If you are using a newer version of Android Studio, it might look like this:

如果你使用的是新版本的Android Studio,可能会是这样的:

prompt to locate your APK file

Clicking the Show in Explorer or locate link, you will be presented with a file explorer positioned somewhere near wherever Android Studio put the APK file:

点击“浏览器”或“定位链接”,你将会看到一个文件资源管理器,它位于Android Studio放置APK文件的任何地方。

File explorer after clicking the link in the APK Generated dialog

But in AS 3, when you click locate, it puts you at the app level. You need to go into the release folder to get your APK file.

但是在AS 3中,当你点击locate,它会把你放到app层。您需要进入发布文件夹以获得您的APK文件。

folder structure in AS 3

folder contents after a build

#4


14  

In my case, I'm using Android Studio 1.0.2, I get my APK file from:

我使用的是Android Studio 1.0.2,我的APK文件来自:

/app/build/outputs/apk/app-debug.apk

#5


8  

If anyone would be missing his APK and couldn't find it in the locations stated in other answers (I found this question, since I couldn't find it either) it might just be in this folder (mine was)

如果有人丢失了他的APK并且在其他答案中找不到它(我找到了这个问题,因为我也找不到它)它可能就在这个文件夹里(我的是)

/target/classes/.apk 

I also had a there this file:

我还有一个文件

.unaligned.apk

I am not perfectly sure, whether the apk is actually the full-blown apk, which should be generated, but I tried it on various devices (not only the target device, but also those which were supporting only the minimum SDK) and it worked.

我不太确定apk是否真的是应该生成的成熟的apk,但是我在不同的设备(不仅是目标设备,还包括那些只支持最小SDK的设备)上进行了尝试,并且成功了。

Hope this will help someone.

希望这能帮助某人。

#6


8  

It is Project_Location/app/build/outputs/apk for Gradle Project

它是Project _location /app/build/output /apk

#7


6  

Find apk using below step:-

使用以下步骤找到apk:-

  1. Goto to your project folder.
  2. Goto到你的项目文件夹。
  3. Open project folder.
  4. 开放的项目文件夹。
  5. Open build folder.
  6. 开放建立文件夹。
  7. Open output folder.
  8. 打开输出文件夹。
  9. Open apk folder.
  10. 开放的apk文件夹。
  11. Now you see your apk.
  12. 现在你看到你的apk了。

hope it will help some body.

希望对身体有所帮助。

#8


6  

So the apk in Android studio is generated inside build folder of app module.

因此,Android studio中的apk是在app模块的build文件夹中生成的。

Correct path to apk would be \app\build\outputs\apk. I am using Android Studio Version 1.4.1. So apk could either be found at app/build/apk/ or \app\build\outputs\apk base on the version of Android studio you are using. Refer the below image

正确的apk路径将是\app\build\输出\apk。我正在使用Android Studio 1.4.1版本。所以apk可以在app/build/apk/或\app\build\output apk上找到,基于你正在使用的Android studio版本。请参考以下图片

Android studio project structure

Also find more reference on these links.

也在这些链接上找到更多的参考。

  1. Building and Running from Studio
  2. 从Studio开始构建和运行
  3. Studio Project Overview
  4. 工作室项目概述

#9


5  

I'm using Android Studio and gradle. It created the build/apk/<.apk> file only when I ran the project. Press the following to run your project: Alt+u, u

我用的是Android Studio和gradle。它创建构建/ apk / <。apk>文件只在我运行项目时。按以下命令运行您的项目:Alt+u, u

Android Studio: 0.5.3 Gradle: 0.9.+

Android Studio: 0.5.3 Gradle: 0.9.+

#10


5  

You can find the APK in:

你可以在以下网址找到APK:

YourProject\app\build\outputs\apk

#11


3  

In the new Android Studio, the signed apk is placed directly in the folder of module for which the apk is built.

在新的Android Studio中,签名的apk直接放在apk构建的模块文件夹中。

For example: For a Project ProjectA containing 2 modules Mod1 and Mod2, the apk files will be found in

例如:对于包含两个模块Mod1和Mod2的项目项目,apk文件将在其中找到

/path-to-ProjectA/Mod1/Mod1.apk

/ path-to-ProjectA Mod1 / Mod1.apk


/path-to-ProjectA/Mod2/Mod2.apk

/ path-to-ProjectA Mod2 / Mod2.apk

Image for APK location in Android Studio

在Android Studio中的APK位置的图像

#12


3  

Build your project and get the apk from your_project\app\build\apk

构建您的项目并从您的_project\app中获取apk

#13


3  

The .apk file is located at [your project]\out\production\[your project name]

apk文件位于[您的项目]\out\production\[您的项目名称]

#14


3  

Location of apk in Android Studio:

apk在Android Studio的位置:

AndroidStudioProjects/ProjectName/app/build/outputs/apk/app-debug-unaligned.apk

AndroidStudioProjects / ProjectName / app /构建/输出/ apk / app-debug-unaligned.apk

#15


3  

As of version 0.8.6 of Android Studio generating an APK file (signed and I believe unsigned, too) will be placed inside ProjectName/device/build/outputs/apk

在版本0.8.6的Android Studio中,生成一个APK文件(签名并且我认为没有签名)将被放置在ProjectName/device/build/output / APK中。

For example, I am making something for Google Glass and my signed APK gets dropped in /Users/MyName/AndroidStudioProjects/HelloGlass/glass/build/outputs/apk

例如,我正在为谷歌玻璃做一些东西,我的签名APK被删除/Users/MyName/ androidoprojects /HelloGlass/ Glass/ build/output / APK

#16


3  

I got the .apk files in parent_folder/out/production/projectname/projectname.apk

我在parent_folder/out/production/projectname/projectname.apk中有。apk文件

#17


2  

You can find your apk file as follow:

你可以找到你的apk档案如下:

yourproject>app>build>output>apk>yourproject.apk

#18


2  

The Android build system is the toolkit you use to build, test, run and package your apps. The build system can run as an integrated tool from the Android Studio menu and independently from the command line. You can use the features of the build system to:

Android构建系统是用来构建、测试、运行和打包应用程序的工具包。构建系统可以作为来自Android Studio菜单的集成工具运行,并且独立于命令行。你可以利用建造系统的特点:

  1. Customize, configure, and extend the build process.
  2. 自定义、配置和扩展构建过程。
  3. Create multiple APKs for your app with different features using the same project and modules.
  4. 使用相同的项目和模块为应用程序创建具有不同功能的多个APKs。

The build process involves many tools and processes that generate intermediate files on the way to producing an .apk. If you are developing in Android Studio, the complete build process is done every time you run the Gradle build task for your project or modules.

构建过程涉及许多工具和过程,它们在生成.apk的过程中生成中间文件。如果您正在Android Studio中开发,那么每次运行项目或模块的Gradle构建任务时,都会完成完整的构建过程。

The build process is very flexible so it's useful, however, to understand what is happening under the hood since much of the build process is configurable and extensible. The following diagram depicts the different tools and processes that are involved in a build:

构建过程是非常灵活的,因此理解在幕后发生的事情是很有用的,因为大多数构建过程是可配置的和可扩展的。下图描述了构建中涉及的不同工具和过程:

Build a release version

You can now use the Build menu options to build the release version of your application for distribution.

现在,您可以使用Build菜单选项来构建应用程序的发行版。

The build generates an APK for each build variant: the app/build/apk/ (or app/build/outputs/apk) directory contains packages named app--.apk; for example, app-full-release.apk and app-demo-debug.apk.

构建为每个构建变体生成一个APK: app/build/ APK /(或app/build/output / APK)目录包含名为app- .apk的包;例如,app-full-release。apk app-demo-debug.apk。

enter image description here

Build output

构建输出

The build generates an APK for each build variant in the app/build folder: the app/build/outputs/apk/ directory contains packages named app--.apk; for example, app-full-release.apk and app-demo-debug.apk.

构建为app/build文件夹中的每个构建变体生成一个APK: app/build/output / APK /目录包含名为app- .apk的包;例如,app-full-release。apk app-demo-debug.apk。

Courtesy goes to Build System Overview

礼貌去构建系统概述

#19


1  

If you have imported a Project from Eclipse and are using the new Android Studio The directory

如果您已经从Eclipse导入了一个项目,并且正在使用新的Android Studio目录

/bin

does exist (there maybe old binaries in here) however with the latest Android Studio update the actual current apk is stored in

是否存在(这里可能有旧的二进制文件)但是随着最新的Android Studio更新实际的apk被存储在里面

/out/production

#20


1  

Add this in your module gradle file. Its not there in default project. Then u will surely find the APK in /build/outputs/apk/

在模块级文件中添加这个。它不在默认项目中。那么你一定会找到APK in /build/output / APK /。

buildTypes {
    debug {
        applicationIdSuffix ".debug"
    }
}

#21


1  

I am using Android Studio 3.0 canary 6.

我使用的是Android Studio 3.0 canary 6。

To build apk,

构建的apk,

Click to Build->Build APK(s).

单击以构建- >构建APK(s)。

After your apk is build, Go to:

在你的apk建立之后,去:

C:\Users\your-pc-name\AndroidStudioProjects\your-app-name\app\build\outputs\apk\debug

#22


0  

For Gradle look here: https://docs.gradle.org/current/dsl/org.gradle.api.tasks.SourceSetOutput.html. "For example: Java plugin will use those dirs in calculating class paths and for jarring the content; IDEA and Eclipse plugins will put those folders on relevant classpath."

在这里查看Gradle: https://docs.gradle.org/current/dsl/org.gradle.api.tasks.SourceSetOutput.html。例如:Java插件将使用这些dirs来计算类路径并干扰内容;IDEA和Eclipse插件将把这些文件夹放到相关的类路径中。

So its depend on plugin build in configs unless you don't define them explicit in config file.

所以它依赖于配置中的插件构建,除非你不在配置文件中明确定义它们。

#23


0  

Click the little gear icon in the project view and make sure "show excluded files" is checked. Otherwise, the IDE will hide output and several other important directories under $project/$module/build/.

单击项目视图中的小齿轮图标,确保选中“显示排除文件”。否则,IDE将在$project/$module/build/中隐藏输出和其他几个重要的目录。

#24


0  

Hello all above all answers are right you can find the apk through the path in android studio but there is exceptions you can't find the build/output folder some times if you can't see it just go to

大家好,首先所有的答案都是正确的你可以通过android studio的路径找到apk但是也有例外,如果你看不见的话,你有时不能找到build/output文件夹

app--> app.iml file and find below line in it :-

app——> app.iml文件,如下行:-

  

--> after removing this line you can see the output folder its just the adding more information to above answers as per my experience :)

——在删除这条线后,您可以看到输出文件夹,它只是根据我的经验在上面的答案中添加更多的信息。

THANKS!~!

谢谢! ~ !

#25


0  

For Android Studio 2.0

为Android Studio 2.0

C:\Users\UserName\AndroidStudioProjects\MyAppName\app\build\outputs\apk

Here UserName is your computer user name and MyAppName is your android app name

这里的用户名是你的电脑用户名,MyAppName是你的安卓应用程序名称。

#26


0  

As of Android Studio 3.0 / Gradle Build Tools 3.0.0, APK artifacts can now be found in foo/bar/build/outputs/apk/flavorName/buildType with respect to your project name, foo, and your module name, bar. There is now a directory for each apk file sorted organized first by flavor (with respect to flavor dimensions) and then by build type.

在Android Studio 3.0 / Gradle Build Tools 3.0.0中,APK构件现在可以在foo/bar/ Build /output / APK /flavorName/buildType中找到,与您的项目名foo和模块名bar有关。现在,每个apk文件都有一个目录,该目录首先按味道(相对于味道维度)排序,然后按构建类型排序。

#27


0  

enter image description here

  1. open Event Log
  2. 打开事件日志
  3. find line: Module 'app': locate or analyze the APK.
  4. 查找行:模块“app”:定位或分析APK。
  5. click on locate link to open folder with apk file!
  6. 点击定位链接打开文件夹与apk文件!

After all: "All built APKs are saved in project-name/module-name/build/outputs/apk/ Build your project LINK

毕竟:“所有构建的APKs都保存在项目名称/模块名称/构建/输出/apk/构建项目链接中。

#28


0  

Hint: If you can´t see the app-debug.apk in your debug folder, you have to click on BUILD --> Rebuild Project in Android Studio.

提示:如果你不能看到app-debug´。在您的调试文件夹中的apk中,您必须单击Android Studio中的BUILD ->重构项目。


推荐阅读
  • 为了确保iOS应用能够安全地访问网站数据,本文介绍了如何在Nginx服务器上轻松配置CertBot以实现SSL证书的自动化管理。通过这一过程,可以确保应用始终使用HTTPS协议,从而提升数据传输的安全性和可靠性。文章详细阐述了配置步骤和常见问题的解决方法,帮助读者快速上手并成功部署SSL证书。 ... [详细]
  • Android 构建基础流程详解
    Android 构建基础流程详解 ... [详细]
  • 分享一款基于Java开发的经典贪吃蛇游戏实现
    本文介绍了一款使用Java语言开发的经典贪吃蛇游戏的实现。游戏主要由两个核心类组成:`GameFrame` 和 `GamePanel`。`GameFrame` 类负责设置游戏窗口的标题、关闭按钮以及是否允许调整窗口大小,并初始化数据模型以支持绘制操作。`GamePanel` 类则负责管理游戏中的蛇和苹果的逻辑与渲染,确保游戏的流畅运行和良好的用户体验。 ... [详细]
  • 在Android应用开发中,实现与MySQL数据库的连接是一项重要的技术任务。本文详细介绍了Android连接MySQL数据库的操作流程和技术要点。首先,Android平台提供了SQLiteOpenHelper类作为数据库辅助工具,用于创建或打开数据库。开发者可以通过继承并扩展该类,实现对数据库的初始化和版本管理。此外,文章还探讨了使用第三方库如Retrofit或Volley进行网络请求,以及如何通过JSON格式交换数据,确保与MySQL服务器的高效通信。 ... [详细]
  • 本文探讨了 Kafka 集群的高效部署与优化策略。首先介绍了 Kafka 的下载与安装步骤,包括从官方网站获取最新版本的压缩包并进行解压。随后详细讨论了集群配置的最佳实践,涵盖节点选择、网络优化和性能调优等方面,旨在提升系统的稳定性和处理能力。此外,还提供了常见的故障排查方法和监控方案,帮助运维人员更好地管理和维护 Kafka 集群。 ... [详细]
  • 在 Windows 10 环境中,通过配置 Visual Studio Code (VSCode) 实现基于 Windows Subsystem for Linux (WSL) 的 C++ 开发,并启用智能代码提示功能。具体步骤包括安装 VSCode 及其相关插件,如 CCIntelliSense、TabNine 和 BracketPairColorizer,确保在 WSL 中顺利进行开发工作。此外,还详细介绍了如何在 Windows 10 中启用和配置 WSL,以实现无缝的跨平台开发体验。 ... [详细]
  • 深入解析 Django 中用户模型的自定义方法与技巧 ... [详细]
  • 在CentOS上部署和配置FreeSWITCH
    在CentOS系统上部署和配置FreeSWITCH的过程涉及多个步骤。本文详细介绍了从源代码安装FreeSWITCH的方法,包括必要的依赖项安装、编译和配置过程。此外,还提供了常见的配置选项和故障排除技巧,帮助用户顺利完成部署并确保系统的稳定运行。 ... [详细]
  • Liferay Portal 中 AutoEscape 构造函数的应用与实例代码解析 ... [详细]
  • Django框架下的对象关系映射(ORM)详解
    在Django框架中,对象关系映射(ORM)技术是解决面向对象编程与关系型数据库之间不兼容问题的关键工具。通过将数据库表结构映射到Python类,ORM使得开发者能够以面向对象的方式操作数据库,从而简化了数据访问和管理的复杂性。这种技术不仅提高了代码的可读性和可维护性,还增强了应用程序的灵活性和扩展性。 ... [详细]
  • 本文深入解析了WCF Binding模型中的绑定元素,详细介绍了信道、信道管理器、信道监听器和信道工厂的概念与作用。从对象创建的角度来看,信道管理器负责信道的生成。具体而言,客户端的信道通过信道工厂进行实例化,而服务端则通过信道监听器来接收请求。文章还探讨了这些组件之间的交互机制及其在WCF通信中的重要性。 ... [详细]
  • 在Java项目中,当两个文件进行互相调用时出现了函数错误。具体问题出现在 `MainFrame.java` 文件中,该文件位于 `cn.javass.bookmgr` 包下,并且导入了 `java.awt.BorderLayout` 和 `java.awt.Event` 等相关类。为了确保项目的正常运行,请求提供专业的解决方案,以解决函数调用中的错误。建议从类路径、依赖关系和方法签名等方面入手,进行全面排查和调试。 ... [详细]
  • 本文深入探讨了Java多线程环境下的同步机制及其应用,重点介绍了`synchronized`关键字的使用方法和原理。`synchronized`关键字主要用于确保多个线程在访问共享资源时的互斥性和原子性。通过具体示例,如在一个类中使用`synchronized`修饰方法,展示了如何实现线程安全的代码块。此外,文章还讨论了`ReentrantLock`等其他同步工具的优缺点,并提供了实际应用场景中的最佳实践。 ... [详细]
  • 每年,意甲、德甲、英超和西甲等各大足球联赛的赛程表都是球迷们关注的焦点。本文通过 Python 编程实现了一种生成赛程表的方法,该方法基于蛇形环算法。具体而言,将所有球队排列成两列的环形结构,左侧球队对阵右侧球队,首支队伍固定不动,其余队伍按顺时针方向循环移动,从而确保每场比赛不重复。此算法不仅高效,而且易于实现,为赛程安排提供了可靠的解决方案。 ... [详细]
  • JVM参数设置与命令行工具详解
    JVM参数配置与命令行工具的深入解析旨在优化系统性能,通过合理设置JVM参数,确保在高吞吐量的前提下,有效减少垃圾回收(GC)的频率,进而降低系统停顿时间,提升服务的稳定性和响应速度。此外,本文还将详细介绍常用的JVM命令行工具,帮助开发者更好地监控和调优JVM运行状态。 ... [详细]
author-avatar
曾明铭智瑜淑岳
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有