简体   繁体   中英

Sign a debug APK file while using cordova run command line

I would like to test and debug a signed version of a APK file, using Apache Cordova command line. When we run either cordova build android or cordova run android --device a APK file is created at:

<project_dir>/platforms/android/build/outputs/apk/debug/android-debug.apk

Can we sign this debug file before sending it to the device while running cordova run android --device ?

Or is this android-debug.apk already signed with a SHA1, and if so how to get that signature?

It's already signed with the certificate of name androiddebugkey in the ~/.android/debug.keystore keystore.

To get the signature:

keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore > debug.crt
openssl sha1 -binary debug.crt > debug.sha
openssl base64 -in debug.sha > debug.txt

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM