Export unsigned apk from a Gradle Project in Android Studio

前端 未结 6 1628
情书的邮戳
情书的邮戳 2020-12-15 16:55

I usually create projects with Eclipse and import them into Android Studio, because I hate the project structure AS gives me. In it´s module settings, I have the possibility

相关标签:
6条回答
  • 2020-12-15 16:59

    As of Android Studio 1.5 you can now generate an APK using

    Build > Build APK
    

    Which you can then find under

    $YOUR_PROJECT/$YOUR_MODULE/build/outputs/apk.

    Edit: New Android Studio gives this Path:

    $YOUR_PROJECT/$YOUR_MODULE/build/outputs/apk.
    
    0 讨论(0)
  • 2020-12-15 17:07

    Open Gradle panel, open the tasks list of your project and double click on BUILD task, then under " -> build -> outputs -> apk" you will find your unsigned APK with name -release-unsigned.apk

    0 讨论(0)
  • 2020-12-15 17:18

    It is also possible to build an apk by using the command line (Android Terminal).

    1. Choose the Terminal in Android Studio - very bottom next to Android Monitor and Version Control
    2. Build apk with command Windows: gradlew.bat assembleRelease Mac: ./gradlew assembleRelease
    3. Find unsigned apk file - /app/build/outputs/apk/app-release-unsigned.apk

    Tested in Android 1.5

    0 讨论(0)
  • 2020-12-15 17:19

    Use

    Build > Make Project
    

    to build an apk file from Android Studio.

    You can get your unsigned apk under the below path

    $YOUR_PROJECT/$YOUR_MODULE/build/apk
    

    unsigned apk files will have "unsigned" text in their names.

    [ UPDATE ] :

    In Recent release of Android Studio you will not get apk file on sysncing or Make Project. There are two other methods in order to get the apk file

    1. Run the app
    2. Execute assemble Task from Gradle panel present in right hand side of Studio window or from embedded terminal window on bottom(in project Root)

    gradlew assembleDebug(or whatever build varient you want a build for)

    and the update new apk path will be

    $YOUR_PROJECT/$YOUR_MODULE/build/outputs/apk
    

    This has been done by Android Tools team to improve the Android Studio performance.

    0 讨论(0)
  • 2020-12-15 17:21

    Edit app.gradle buildTypes block, set

    signingConfig null
    

    Then rebuild.

    0 讨论(0)
  • 2020-12-15 17:24

    The above answer of pyus13 did not work for me (Android Studio 0.8.1).

    Instead use

    Run > Run "YourProject"
    

    to build the code and create the unsigned apk. You can find your apk file under

    $YOUR_PROJECT/$YOUR_MODULE/build/outputs/apk
    

    UPDATE

    Still works with Android Studio 1.5.1 You only get new APKs when you have code changes since you last built your code.

    0 讨论(0)
提交回复
热议问题