[android] Build unsigned APK file with Android Studio

I'm developing an Android app with the Android Developer Tool. Now I tried the new Android Studio, everything works fine if connect my smartphone with the PC and directly run the program in the Android Studio. But now I want to test the program with other smartphones without connecting them to my PC.

The ADT creates the .apk file under "projectname/bin" every time you compile the program. How I see it at the moment, Android Studio doesn't do that.

So, my question is: Is it possible to create an unsigned .apk file with Android Studio?

This question is related to android build apk android-studio

The answer is


The easiest way, I guess:

  • Open Gradle tab on the right side
  • Double click YourProject/:app/assemble (or assembleDebug)
  • You'll find the apk here
    .../YourProject/app/build/outputs/apk/app-debug.apk

screenshot


AndroidStudio 3.4


After Grade Build Running complete, you will see the notification at bottom-right corner like.

Click on locate and you will see your debuggable APK


Following work for me:

Keep following setting blank if you have made in build.gradle.

signingConfigs {
        release {
            storePassword ""
            keyAlias ""
            keyPassword ""
        }
    }

and choose Gradle Task from your Editor window. It will show list of all flavor if you have created.

enter image description here


just go to BUILD->Build APK and it's done


Just go to Your Application\app\build\outputs\apk

and copy both to phone and install app-debug.apk


Android studio also create the apk file on every time compile the program, just go to your workspace folder and find app->build->outputs-> then you can see the apk file.


You can click the dropdown near the run button on toolbar,

  1. Select "Edit Configurations"
  2. Click the "+"
  3. Select "Gradle"
  4. Choose your module as Gradle project
  5. In Tasks: enter assemble

Now press ok,

all you need to do is now select your configuration from the dropdown and press run button. It will take some time. Your unsigned apk is now located in

Project\app\build\outputs\apk

For unsigned APK: Simply set signingConfig null. It will give you appName-debug-unsigned.apk

debug {
     signingConfig null
}

And build from Build menu. Enjoy

For signed APK:

signingConfigs {
        def keyProps = new Properties()
        keyProps.load(rootProject.file('keystore.properties').newDataInputStream())
        internal {
            storeFile file(keyProps.getProperty('CERTIFICATE_PATH'))
            storePassword keyProps.getProperty('STORE_PASSWORD')
            keyAlias keyProps.getProperty('KEY_ALIAS')
            keyPassword keyProps.getProperty('KEY_PASSWORD')
        }
    }
    buildTypes {
        debug {
            signingConfig signingConfigs.internal
            minifyEnabled false
        }
        release {
            signingConfig signingConfigs.internal
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

keystore.properties file

CERTIFICATE_PATH=./../keystore.jks
STORE_PASSWORD=password
KEY_PASSWORD=password
KEY_ALIAS=key0

Step 1 Open android studio . Build -> Generate Signed APK… . now click on “Generate Signed APK”.

enter image description here

Step 2

enter image description here

Click Create new.

Step 3

Fill the details and click ok. enter image description here

jks key details,It will go back to previous window.

enter image description here

Click Next, and give the password which you stored in key.

Step 4

enter image description here

Now click Finish and wait to complete the building process.

enter image description here

Now apk generated successfully. Click show in Explorer.

enter image description here

If you need more details please visit and check the live demo http://javaant.com/how-to-make-apk-file-in-android-studio/#.VwzedZN96Hs


I solve it!

First off all, you should add these:

defaultConfig { 
 multiDexEnabled true
}

dependencies {
 implementation 'com.android.support:multidex:1.0.3'
}

After, you should click Build in top bar of Android Studio:

Build > Build Bundle(s) / APK(s) > Build APK(s)

Finally, you have an app-debug.apk file in:

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

Note: apk, debug, app-debug.apk files created automatically in outputs file by Android Studio.


Steps for creating unsigned APK

_x000D_
_x000D_
Steps for creating unsigned APK_x000D_
_x000D_
• Click the dropdown menu in the toolbar at the top_x000D_
• Select "Edit Configurations"_x000D_
• Click the "+"_x000D_
• Select "Gradle"_x000D_
• Choose your module as a Gradle project_x000D_
• In Tasks: enter assemble_x000D_
• Press Run_x000D_
• Your unsigned APK is now located in - ProjectName\app\build\outputs\apk_x000D_
_x000D_
Note : Technically, what you want is an APK signed with a debug key. An APK that is actually unsigned will be refused by the device. So, Unsigned APK will give error if you install in device.
_x000D_
_x000D_
_x000D_

Note : Technically, what you want is an APK signed with a debug key. An APK that is actually unsigned will be refused by the device. So, Unsigned APK will give error if you install in device.


According to Build Unsigned APK with Gradle you can simply build your application with gradle. In order to do that:

  1. click on the drop down menu on the toolbar at the top (usually with android icon and name of your application)
  2. select Edit configurations
  3. click plus sign at top left corner or press alt+insert
  4. select Gradle
  5. choose your module as Gradle project
  6. in Tasks: enter assemble
  7. press OK
  8. press play

After that you should find your unsigned 'apk' in directory ProjectName\app\build\outputs\apk


Yes, it is possible to create an unsigned .apk with Android Studio!

Highlight the Project in your package explorer or project column, and then File - Project Structure - Artifacts - + - Android Application - From module 'your app' and then you can change the location and some other options. I enable build on make, just for ease.


In Android Studio:

  1. Build

  2. Build APK(s)

  3. Wait and go to the location shown in a pop-up window. On right bottom side

enter image description here


With Android Studio 2.2.3 on OSX I just used the top menu:

Build > Build APK

It opened Finder with the .apk file. This won't generate a signed APK. You can select Generate Signed APK from the same menu if needed.


Build -> Build APK     //unsigned app


Build -> Generate Signed APK  //Signed app

--- Create new config in signingConfigs

unsigned {
        //do not sign
    }

--- Create build type in buildTypes

unsigned {
        versionNameSuffix '-unsigned'
    }

--- Go to build variants and chose unsigned standard. Build project.

--- Go to "outputs/apk" and find "XXX-unsigned.apk". To check if it is unsigned try to install it to device - you'll fail.


Now in Android Studio v1.1.0 should be:

  1. select Run > Run <your app>
  2. find .apk file in <your app>\build\outputs\apk

Examples related to android

Under what circumstances can I call findViewById with an Options Menu / Action Bar item? How to implement a simple scenario the OO way My eclipse won't open, i download the bundle pack it keeps saying error log getting " (1) no such column: _id10 " error java doesn't run if structure inside of onclick listener Cannot retrieve string(s) from preferences (settings) strange error in my Animation Drawable how to put image in a bundle and pass it to another activity FragmentActivity to Fragment A failure occurred while executing com.android.build.gradle.internal.tasks

Examples related to build

error: This is probably not a problem with npm. There is likely additional logging output above Module not found: Error: Can't resolve 'core-js/es6' WARNING in budgets, maximum exceeded for initial How can I change the app display name build with Flutter? Error - Android resource linking failed (AAPT2 27.0.3 Daemon #0) Still getting warning : Configuration 'compile' is obsolete and has been replaced with 'implementation' Could not find com.android.tools.build:gradle:3.0.0-alpha1 in circle ci Error:Execution failed for task ':app:compileDebugKotlin'. > Compilation error. See log for more details Component is part of the declaration of 2 modules Maven build Compilation error : Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project Maven

Examples related to apk

Application Installation Failed in Android Studio Difference between signature versions - V1 (Jar Signature) and V2 (Full APK Signature) while generating a signed APK in Android Studio? Session 'app': Error Installing APK Android Error Building Signed APK: keystore.jks not found for signing config 'externalOverride' Build and Install unsigned apk on device without the development server? The APK file does not exist on disk Android Studio: Application Installation Failed How to retrieve Key Alias and Key Password for signed APK in android studio(migrated from Eclipse) ADB Install Fails With INSTALL_FAILED_TEST_ONLY Upload failed You need to use a different version code for your APK because you already have one with version code 2

Examples related to android-studio

A failure occurred while executing com.android.build.gradle.internal.tasks "Failed to install the following Android SDK packages as some licences have not been accepted" error Android Gradle 5.0 Update:Cause: org.jetbrains.plugins.gradle.tooling.util This version of Android Studio cannot open this project, please retry with Android Studio 3.4 or newer WARNING: API 'variant.getJavaCompile()' is obsolete and has been replaced with 'variant.getJavaCompileProvider()' Flutter plugin not installed error;. When running flutter doctor ADB.exe is obsolete and has serious performance problems Android design support library for API 28 (P) not working Flutter command not found How to find the path of Flutter SDK