Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Testing release builds on android without signing

I'm attempting to do some performance analysis on android/JNI.

How do I generate a release build for testing?

I know it's possible, as I've successfully produced a binary and executed it with no signing whatsoever via an Android.mk file, but I'm trying to move to android studio, and it won't let me generate a test-build. Entering garbage in the key fields doesn't seem to work

This is just a test-project to validate I can get the performance I need. It'll never be distributed, or run on any device other then the one on my desk.

Can I just turn all the code verification off entirely? I'm doing validation now, and the end-use of this project is a non-internet-connected device which is intended to be treated as a black-box appliance.

like image 549
Fake Name Avatar asked Oct 11 '17 23:10

Fake Name


2 Answers

Ok, as far as I can tell, it's impossible to disable the forced requirement, presumably because someone at google makes truly horrible design decisions.

You can, however, just use the debug keystore:

signingConfigs {
    garbage_key {
        keyAlias 'androiddebugkey'
        keyPassword 'android'
        storeFile file('C:/Users/<your_user>/.android/debug.keystore')
        storePassword 'android'
    }
}

Back to trying to get gradle to do anything sensible. This is by far the worst build disaster I've ever worked with.

like image 73
Fake Name Avatar answered Nov 20 '22 12:11

Fake Name


from the terminal/console use gradlew to create a release build

./gradlew assembleRelease

Once the command finishes you can find the unsigned apk named 'app-release-unsigned.apk' in the following path

PROJECT_NAME/app/build/outputs/apk/release/ 

if you have setup release configs in build.gradle file, you may temporary comment it out

buildTypes {
    /*release { ... } */
}

and

signingConfigs {

    /*release { ... } */
}
like image 3
Rinav Avatar answered Nov 20 '22 11:11

Rinav