ionic build --release android

ionic bulid android

keytool -genkey -v -keystore demo.keystore -alias demo.keystore -keyalg RSA -validity 20000

jarsigner -verbose -keystore /yourpath/demo.keystore -signedjar demo_signed.apk demo.apk demo.keystore

zipalign -v 4 your_project_name-unaligned.apk your_project_name.apk

Signing Your App Manually
You do not need Android Studio to sign your app. You can sign your app from the command line using standard tools from the Android SDK and the JDK. To sign an app in release mode from the command line:

Generate a private key using keytool. For example:

1, keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000
2,jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore my_application.apk alias_name
3,jarsigner -verify -verbose -certs my_application.apk
4,zipalign -v 4 your_project_name-unaligned.apk your_project_name.apk

 

This example prompts you for passwords for the keystore and key, and to provide the Distinguished Name fields for your key. It then generates the keystore as a file called my-release-key.keystore. The keystore contains a single key, valid for 10000 days. The alias is a name that you will use later when signing your app.
Compile your app in release mode to obtain an unsigned APK.
Sign your app with your private key using jarsigner:
$ jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1
-keystore my-release-key.keystore my_application.apk alias_name
This example prompts you for passwords for the keystore and key. It then modifies the APK in-place to sign it. Note that you can sign an APK multiple times with different keys.
Verify that your APK is signed. For example:
$ jarsigner -verify -verbose -certs my_application.apk
Align the final APK package using zipalign.
$ zipalign -v 4 your_project_name-unaligned.apk your_project_name.apk
zipalign ensures that all uncompressed data starts with a particular byte alignment relative to the start of the file, which reduces the amount of RAM consumed by an app.

 

https://play.google.com/apps/publish/?

jarsigner是工具名称,-verbose表示将签名过程中的详细信息打印出来;
-keystore /yourpath/demo.keystore 之前生成的证书
-signedjar demo_signed.apk 签名后的apk
demo.apk 需要签名的apk
demo.keystore 证书的别名

附:查看apk的签名

Mac下,把apk的后缀改为zip打开,然后查看META-INF下的.RSA文件
Windows下,用winner打开apk,同样查看.RSA文件
执行命令

keytool -printcert -file META-INF/CERT.RSA
1
注意后面文件的名称与路径即可,可以查看到签名信息,主要是查看Certificate fingerprints下的MD5与SHA1,这两个不同就代表着签名不同。

时间: 2024-10-16 12:20:45

ionic build --release android的相关文章

ionic build android log

RubertdeMacBook-Pro:~ Rubert$ ionic build android Current working directory is not a Cordova-based project. RubertdeMacBook-Pro:~ Rubert$ cd myApp/ RubertdeMacBook-Pro:myApp Rubert$ ionic build android Running command: /Users/Rubert/myApp/hooks/after

Ionic项目打包Android版本实战

最近在带团队做一个前端用Ionic+angularjs 的web app项目,由于自身不是做前端的,所以不太了解ionic,正好前端人员也是半吊子,所以只有自力更生学着自己打android包,在网上不断搜索打包方案,不断测试不断掉坑又不断解决再掉坑再解决后,终于在一天半时间android打包成功.接下来我把这些经验记录下来,希望能给大家提供参考和帮助. 配置Ionic下面android打包 1.安装Node.js下载安装:http://nodejs.org/ 安装完成之后打开PowerShell

ionic框架对Android返回键的处理

在HybridApp移动跨平台开发中,android平台会遇到一些比较特殊并难以解决的问题,这些问题在原生应用开发中很easy, Android的返回键处理就是问题之一,假如我们要实现一个在很多App中都有的在主页按返回键弹出对话框提示用户退出应用的功能,在原生应用开发中是很容易的,只要在onKeyUp事件里面对返回键事件进行处理就可以了.按2次返回键退出应用的Java代码如下: private long exitTime = 0; @Override public boolean onKeyD

xcode下build release版本的.a库

1. 点击房子 图标按钮 2. 弹出下拉菜单选择Edit Scheme 条目 3. 如下图,在左边table控件中选择 Run,然后右边 Info 条目下面选择 Build Configuration,选择Release项目. 4. 验证结果 打开product下.a 所在的目录,如下图,Release-iphoneos 表示 armv7架构下的.a 输出目录,前缀是Release表示版本.. 5. 使用lipo创建兼容版本的静态库 lipo -create Release-iphoneos/l

cocos2dx 编译错误 BUILD FAILEDG:\android\SDK\android-sdk-windows\tools\ant\build.xml:645: The following

BUILD FAILEDG:\android\SDK\android-sdk-windows\tools\ant\build.xml:645: The following erroroccurred while executing this line:G:\android\SDK\android-sdk-windows\tools\ant\build.xml:683: null returned: 1 解决办法: rd bin /S /Q cocos2dx 编译错误 BUILD FAILEDG:

运行node.js报错:Cannot find module '../build/Release/bson'] code: 'MODULE_NOT_FOUND' } js-bson

具体报错内容: { [Error: Cannot find module '../build/Release/bson'] code: 'MODULE_NOT_FOUND' } js-bson: Failed to load c++ bson extension, using pure JS version   第一步: 找到 module mongodb ..node_modules\mongodb\node_modules\bson\ext\index.js 并改变bson引用的路径 bso

mongoDB报错Cannot find module '../build/Release/bson'

打算用nodejs写一个blog系统,发现nodejs还是存在很多的坑.在使用mongodb时遇到如下报错问题: { [Error: Cannot find module '../build/Release/bson'] code: 'MODULE_NOT_FOUND' } js-bson: Failed to load c++ bson extension, using pure JS version 折腾了一番,最后是这样解决的: 找到 npm 的module mongodb ..node_

前端打包工具——build release介绍

前言 对于前端开发者来说,资源打包是日常过程中一个必不可少的过程:目前我们大多数时候使用grunt.gulp.webpack这三个工具来完成这个工作:但是有一个特点就是我们没创建一个项目都要对应的去编写配置来完成打包任务,相当的繁琐,而且各种各样的配置挺让人头疼的.本人就是基于这个原因开发了一个命令行打包工具--build release:现放上使用指南,欢迎各位前端爱好者交流指正! 安装 本工具强依赖于Compass,所以安装之前请先确保您的电脑已经成功安装Compass npm instal

ionic build Android错误记录未解决

1.try itcordova -v cordova create testing cd testing cordova plugin add cordova-plugin-sim cordova platform add android cordova build android