Extracting an APK directly from Android Studio is a fundamental skill for any developer, whether you are preparing for internal testing, deploying to a staging environment, or simply archiving your work. While the Android Studio IDE provides a streamlined graphical interface for building and running applications, understanding the underlying process of locating the generated APK file is crucial for efficiency and debugging. This guide walks you through the standard and alternative methods to find your compiled Android application package.

Locating the Default Output Directory

When you build a project in Android Studio, the IDE automatically compiles your code and resources into an APK file, storing it in a specific location within your project's file structure. By default, this file is generated every time you run or build your application, ensuring you always have the latest version available for deployment. You do not necessarily need to navigate manually if you use the run button, but knowing where the file lives is essential for retrieving it later.
The "Build" Folder

The most consistent place to find your APK is within the app module of your project. Navigate to your project directory and look for the app/build/outputs/apk folder. Inside, you will typically find a debug folder containing your debug APK, which is the version created when you run the application for testing purposes during development.
- Open your project file explorer within Android Studio.
- Locate the app module.
- Drill down into
build -> outputs -> apk. - You will see the
debugAPK file, usually namedapp-debug.apk.

Using the Build Menu for Instant Access
If you want to retrieve the APK without diving into the file system, Android Studio offers a direct method through the top menu bar. This approach is particularly useful immediately after building the project, as it provides a quick shortcut to the location of the file on your disk.
The "Reveal in Finder/Explorer" Option

After a successful build, you can instruct Android Studio to show you the file immediately. To do this, locate the Build menu at the top of your screen. While your project is selected, click on Build and look for options like Select Build Directory or Reveal in Finder (macOS) / Show in Explorer (Windows). This action instantly opens the exact folder containing your APK, saving you time.
Generating a Signed APK for Production
For releasing your application on the Google Play Store or distributing it to testers, you must generate a signed APK or Android App Bundle (AAB) rather than using the debug variant. Android Studio provides a dedicated wizard to guide you through this process, ensuring the correct keys and configurations are applied.

To initiate this process, navigate to the top menu and select Build. From the dropdown menu, choose Generate Signed Bundle or APK. Follow the prompts to create or select a keystore, define your package name, and specify the destination where the final signed file should be saved. This generated file is the secure artifact required for official distribution.
Alternative: The Gradle Console Method




















For developers who prefer working with the terminal or need to automate builds, the Gradle wrapper provides a command-line interface to build the APK. You can trigger this process directly from the Android Studio bottom panel, which houses the Gradle tool window. This method is often faster and provides more granular control over the build types and flavors.
Within the Gradle panel, expand the Tasks section, then android, and double-click on assembleDebug or assembleRelease. Once the process completes, you can click on the linked output file path that appears in the console log. This link acts as a shortcut, directing you straight to the newly created APK in your file system.
Troubleshooting Missing APKs
If you are unable to locate the APK using the methods above, it usually indicates a build configuration issue or a problem with the project setup. Ensuring your build.gradle (Module) file is correctly configured is vital, as this file dictates where outputs are sent and the structure of the final package.
First, verify that the applicationId matches your expectations. Next, check the build.gradle file for any custom outputDirectory settings that might redirect the APK to a non-standard location. Cleaning the project via Build -> Clean Project followed by a rebuild can also resolve scenarios where old or corrupted files prevent the new APK from generating correctly.