0

I have built and signed my APK from Android Studio. Now I want to run the signed APK in Android Studio. How can I do this?

thanks -Sonam

Katlock
  • 1,200
  • 1
  • 17
  • 41

3 Answers3

3

This isn't really a typical use case and as such it's not really supported in the way you want. Here are 4 possible alternatives:

Changing your Build Variant to release is one way you can still deploy the app from Android Studio while being able to verify the signed version will work as expected.

If you are trying to install the app onto an emulator, you can simply drag and drop the signed APK from your folder into the emulator window and it will install the app for you.

For a physical device you can drag and drop the APK to your devices downloads folder, from the device you now view your downloads and tap the APK and select install.

You can also just drag and drop the APK into Google Drive or Dropbox and download it from your phone and run it that way.

CodyEngel
  • 1,501
  • 14
  • 22
  • I want to debug my production APK and see why it's crashing. I have a crash report but it doesn't tell much except the following: "Caused by: java.lang.NoSuchFieldException: No field PUBLIC_ONLY in class Lcom/a/a/a/g; (declaration of 'com.a.a.a.g' appears in /data/app" – Katlock Jan 06 '17 at 01:30
  • With your phone plugged into Android Studio you should be able to go to `Android Monitor` > `Select Your Device` > `Select Your App`. Here's a [screenshot](http://imgur.com/h9nZMTF) as an example. – CodyEngel Jan 06 '17 at 01:34
2

The answer is that you don't use Android Studio.

Use the adb install command from the CLI:

adb install myApp.apk

For overinstall, use the -r parameter.

Here is what it should look like:

enter image description here

Daniel Nugent
  • 43,104
  • 15
  • 109
  • 137
1

Add the following to your build.gradle:

signingConfigs{
    key{
        keyAlias 'your key alias'
        keyPassword 'your keypassword'
        storeFile file('path/to/yourfile.keystore')
        storePassword 'your storepassword'
    }
}
buildTypes {
    debug{
        signingConfig signingConfigs.key
    }

These already answered questions may help you:

How can deploy signed APK when click Run in Android Studio?

Android Studio - Run signed apk on emulator

Community
  • 1
  • 1
Muntaser Ahmed
  • 4,487
  • 1
  • 16
  • 17