Reputation: 5881
I have an APK which I got out of a CI pipeline. The CI pipeline builds in release mode but only generates unsigned APKs.
In order to test the generated APK on a real device, I would like to sign it with my debug key. (I have an earlier version of that APK installed, built locally and signed with my debug key, and would like to keep the data.)
Is that possible? How do I do that from the command line?
Upvotes: 0
Views: 1095
Reputation: 324
Assumig you have a debug key, try this command -
jarsigner -verbose -keystore ~/.android/debug.keystore -storepass android -keypass android path/to/my.apk androiddebugkey
(The default key store resides in ~/.android/debug.keystore
, both passphrases are android
, and the key alias to use is androiddebugkey
.)
And, next to verify its signature use
jarsigner -verify -verbose -certs app-release-unsigned.apk
Note that the APK will be modified; work on a copy if you don’t want that.
Upvotes: 1