Qamar
Qamar

Reputation: 5137

How to install apk without rebuilding whole project in Android Studio

Building apk for large project take much time to process all Gradle task.
I have try this but it clean and build

$ gradle installDebug

How to write separate gradle task and add to project Gradle run configuration.
So that by simply excuting gradle task it install existing build debug apk or release apk or any other build type without rebuidling it.
It will save deployment time of apk in multiple devices

Upvotes: 0

Views: 2985

Answers (2)

user2552399
user2552399

Reputation: 66

Hope this can help you: I created a new shell file install_apk:

#!/bin/bash

# Usage
#   run ./install_apk          # to install debug apk
#   run ./install_apk release  # to install release apk

if [ $1 == "release" ]; then
    adb install -r ./app/build/outputs/apk/app-release.apk
    echo "install release apk"
else
    echo "install debug apk"
    adb install -r ./app/build/outputs/apk/app-debug.apk
fi

Upvotes: 2

bartol
bartol

Reputation: 251

you can update android studio to version > 2.0 which has instant run as a built in feature

http://tools.android.com/tech-docs/instant-run

here some more details , cheers

Upvotes: 0

Related Questions