skip to Main Content

When I click the Run button in Android Studio, it installs and runs the app on the device.

If I carry the device to a different machine, where I check out the same app and click run, it will tell me that this build is signed with a different key, so the app first has to be uninstalled, which takes time and deletes the app’s data.

I would like to use the same key on both machines, so that I can switch between them.

Where do I find that key, or even better, is its location configurable?

2

Answers


  1. For development build you could just build the .apk file without any key. But if you are referring to signing key need by Google Play to upload the apps, you could create it in Android Studio.

    Please make sure, you select .apk file for development build(not bundle) if you intend to just test it on your device.

    Login or Signup to reply.
  2. The debug.keystore file is located in the following paths:

    • Linux and MacOS: ~/.android/debug.keystore
    • Windows: C:Users%username%.androiddebug.keystore

    If you want to change debug.keystore to your keystore, then add the following code to your app level build.gradle:

    android {
        ...
        signingConfigs {
            debug {
                storeFile file("path/to/your/debug.keystore")
                storePassword 'password'
                keyAlias 'alias'
                keyPassword 'password'
            }
        }
        ...
    }
    

    If you need to sign a release build, then add the following code:

    android {
        ...
        signingConfigs {
            release {
                storeFile file("path/to/your/release.keystore")
                storePassword 'password'
                keyAlias 'alias'
                keyPassword 'password'
            }
        }
        ...
    }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search