I started using new Android Studio and cant find the APK of the application in IDE,where it actually locates?
我开始使用新的Android Studio,却无法在IDE中找到应用程序的APK。
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.
然而,我不能强调不这样做的重要性。
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
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:
A dialog will appear:
会出现一个对话框:
If you are using a newer version of Android Studio, it might look like this:
如果你使用的是新版本的Android Studio,可能会是这样的:
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文件的任何地方。
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文件。
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
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.
希望这能帮助某人。
8
It is Project_Location/app/build/outputs/apk for Gradle Project
它是Project _location /app/build/output /apk
6
Find apk
using below step:-
使用以下步骤找到apk:-
build
folder.output
folder.apk
folder.apk
. hope it will help some body.
希望对身体有所帮助。
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版本。请参考以下图片
Also find more reference on these links.
也在这些链接上找到更多的参考。
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.+
5
You can find the APK in:
你可以在以下网址找到APK:
YourProject\app\build\outputs\apk
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位置的图像
3
Build your project and get the apk
from your_project\app\build\apk
构建您的项目并从您的_project\app中获取apk
3
The .apk
file is located at [your project]\out\production\[your project name]
apk文件位于[您的项目]\out\production\[您的项目名称]
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
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
3
I got the .apk files in parent_folder/out/production/projectname/projectname.apk
我在parent_folder/out/production/projectname/projectname.apk中有。apk文件
2
You can find your apk file as follow:
你可以找到你的apk档案如下:
yourproject>app>build>output>apk>yourproject.apk
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菜单的集成工具运行,并且独立于命令行。你可以利用建造系统的特点:
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:
构建过程是非常灵活的,因此理解在幕后发生的事情是很有用的,因为大多数构建过程是可配置的和可扩展的。下图描述了构建中涉及的不同工具和过程:
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。
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
礼貌去构建系统概述
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
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"
}
}
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
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.
所以它依赖于配置中的插件构建,除非你不在配置文件中明确定义它们。
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/中隐藏输出和其他几个重要的目录。
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!~!
谢谢! ~ !
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是你的安卓应用程序名称。
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文件都有一个目录,该目录首先按味道(相对于味道维度)排序,然后按构建类型排序。
0
After all: "All built APKs are saved in project-name/module-name/build/outputs/apk/ Build your project LINK
毕竟:“所有构建的APKs都保存在项目名称/模块名称/构建/输出/apk/构建项目链接中。
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 ->重构项目。