167

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

immutable
  • 2,174
  • 3
  • 20
  • 27

31 Answers31

124

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

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

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

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

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

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

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

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

Note: this is will become deprecated sometimes around 1.0

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.

MarkoMilos
  • 197
  • 7
Xavier Ducrohet
  • 28,383
  • 5
  • 88
  • 64
  • Is there a way to automatically define which module is your main module and what is the destination (and name) of final project APK file? – Alex Semeniuk Dec 17 '13 at 10:57
  • Good answer! This worked for me on Android Studio beta 0.8.2 `Foo/*/build/outputs/apk/...` but for some reason outputs directory is hidden and I can't see it inside Android Studio, any hint? – Dragan Marjanović Jul 23 '14 at 09:15
  • To me, this is not true any more. I found the APK under the "intermediates" folder. – Jiří Křivánek Aug 18 '23 at 11:27
81

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

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

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

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

MyApp/myapp/build/outputs/apk/myapp-debug.apk
DarkLeafyGreen
  • 69,338
  • 131
  • 383
  • 601
60

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

In the Build menu, select 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:

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:

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.

folder structure in AS 3

folder contents after a build

Dale
  • 5,520
  • 4
  • 43
  • 79
14

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

<myAndroidProject>/app/build/outputs/apk/app-debug.apk
MartyIX
  • 27,828
  • 29
  • 136
  • 207
Ala Eddine JEBALI
  • 7,033
  • 6
  • 46
  • 65
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)

<project folder>/target/classes/<appname>.apk 

I also had a there this file:

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

Hope this will help someone.

Ev0oD
  • 1,395
  • 16
  • 33
8

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

Bhargav Thanki
  • 4,924
  • 2
  • 37
  • 43
7

Find apk using below step:-

  1. Goto to your project folder.
  2. Open project folder.
  3. Open build folder.
  4. Open output folder.
  5. Open apk folder.
  6. Now you see your apk.

hope it will help some body.

duggu
  • 37,851
  • 12
  • 116
  • 113
6

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

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

Android studio project structure

Also find more reference on these links.

  1. Building and Running from Studio
  2. Studio Project Overview
N-JOY
  • 10,344
  • 7
  • 51
  • 69
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: 0.5.3 Gradle: 0.9.+

  • 1
    From all the answers, that one solve it correctly. apk was only created when I ran the project. I didn't need to start the emulator. Just pressed the play button to the side of the project name. Is there another way to force Android Studio do create the apk files? – Francisco Junior Aug 16 '14 at 04:02
5

You can find the APK in:

YourProject\app\build\outputs\apk
Matt
  • 74,352
  • 26
  • 153
  • 180
Binod Singh
  • 682
  • 4
  • 11
  • 22
4

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

Matt
  • 74,352
  • 26
  • 153
  • 180
Oscar Shon
  • 41
  • 1
3

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

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

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


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

Image for APK location in Android Studio

TheGT
  • 412
  • 8
  • 13
  • 1
    How do I know which module is the *main* application module? Is there a possibility (for example, for some script) to exactly define the resulting APK file path and name when everything I know is the root project directory location? – Alex Semeniuk Dec 17 '13 at 10:56
3

Location of apk in Android Studio:

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

Richa
  • 700
  • 8
  • 12
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

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

Stephen Tetreault
  • 769
  • 1
  • 8
  • 26
3

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

Abhishek Ranjan
  • 238
  • 2
  • 14
2

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

Matt
  • 74,352
  • 26
  • 153
  • 180
Anil Ugale
  • 1,143
  • 2
  • 9
  • 23
2

You can find your apk file as follow:

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:

  1. Customize, configure, and extend the build process.
  2. Create multiple APKs for your app with different features using the same project and modules.

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.

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.

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.

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.

Courtesy goes to Build System Overview

IntelliJ Amiya
  • 74,896
  • 15
  • 165
  • 198
2

I am using Android Studio 3.0 canary 6.

To build apk,

Click to Build->Build APK(s).

After your apk is build, Go to:

C:\Users\your-pc-name\AndroidStudioProjects\your-app-name\app\build\outputs\apk\debug
Martin Evans
  • 45,791
  • 17
  • 81
  • 97
1

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

/bin

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

/out/production
Ed Manners
  • 459
  • 4
  • 8
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/

buildTypes {
    debug {
        applicationIdSuffix ".debug"
    }
}
Muhammad
  • 425
  • 1
  • 6
  • 14
1

enter image description here

  1. open Event Log
  2. find line: Module 'app': locate or analyze the APK.
  3. click on locate link to open folder with apk file!

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

Andrew Glukhoff
  • 898
  • 11
  • 9
1

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.

Dennis Allert
  • 580
  • 1
  • 9
  • 8
1

To create apk in android studio,go to build menu->build bundles/apk->build apk

it will make the apk file of your project.After this the apk will be available in your

project directory->app->build->outputs->apk->debug->app-debug.apk

CodMania
  • 27
  • 8
1

Click on Build-Build Bundles/Apks-Build Apk.

A notification will which shows app location when you click on 'locate' on the notification.

If you have already done creating apk, goto : C:\Users\\AndroidStudioProjects\\app\build\outputs\apk\debug

Abhi Raj
  • 11
  • 3
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."

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

vitalii
  • 443
  • 6
  • 10
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/.

Kevin Krumwiede
  • 9,868
  • 4
  • 34
  • 82
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

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

  <excludeFolder url="file://$MODULE_DIR$/build/outputs" />

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

THANKS!~!

Hardy
  • 2,576
  • 1
  • 23
  • 45
0

For 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

Nurul Akter Towhid
  • 3,046
  • 2
  • 33
  • 35
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.

Fargonaut
  • 771
  • 4
  • 20
0

First the apk has to be built. In Android Studio, Build > Build Bundle(s) / APK(s) > Build APK(s). Then find the apk in C:\Users\AndroidStudioProjects\app\build\outputs\apk\debug.