Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the debug.keystore location in Android Studio?

I am using Ubuntu for Android Development. I launch Android Studio as a root user every time. So my SDK files are all located at /root/Android/Sdk.

I also have my debug.keystore file located at

/root/.android/debug.keystore

But whenever I run my app the following error shows up

/home/USERNAME/.android/debug.keystore (No such file or directory)

Looks like Android Studio is looking for the debug.keystore inside /home/USERNAME/.android/debug.keystore instead of /root/.android/debug.keystore and hence the error.

How could I change this and force Android Studio to look for the debug.keystore file in my /root/.android directory?

One solution I thought of was to launch Android Studio as a local user (non-root user), so that everything fits up. But that'll have two installations of Android Studio on my system (one as root and one as local user) and I don't want that.

Any help would be appreciated. Thank you.

like image 576
Jon Doe Avatar asked Feb 02 '19 09:02

Jon Doe


People also ask

How do I change the debug keystore?

After clicking on the app, Navigate to Tasks. Inside Tasks, navigate to “android” and double click on the signing report option. After clicking on this option you will get to see the path for your debug. keystore file.

Where is the Android debug keystore?

The default keystore file: debug. keystore is present in the folder . android which is usually located in the default home folder of your operating system of the user who installed that Android SDK.

What is keystore path in Android Studio?

Key Store Path is the location where your keystore should be created.

Where are Android keystore files stored?

Keystore file is stored and secured in Google play. Your APKs will be signed by Google Play with app signing key and published to users. Even if you lost your upload key you can contact with Google and you can update your application after validating your account.


1 Answers

You can specify the keystore location in your app's build.gradle file like:

android {
    signingConfigs {
        debug {
            storeFile file("/root/.android/debug.keystore")
        }
    }
}

like image 144
laalto Avatar answered Sep 28 '22 01:09

laalto