Android签名生成keystore

说明:此方法适用在MAC中,对于windows系统,没有尝试过

1、打开终端

2、去到java安装的根目录,即输入

1
cd /Library/Java/Home/bin/

3、当前用户没有最高权限,在Library文件夹下不能生成任何文件,可以到当前用户目录下生成文件

1
keytool -genkey -v -keystore android.keystore -alias android -keyalg RSA -validity  20000  -keystore /Users/当前用户的用户名/android_demo.keystore

如果当前的用户名是xiaohong,则如下

1
keytool -genkey -v -keystore android.keystore -alias android -keyalg RSA -validity  20000   -keystore /Users/ xiaohong/android_demo.keystore

4、按照提示输入即可,完整代码如下

xiaohongdeiMac:/ xiaohong$ cd /Library/Java/Home/bin/
xiaohongdeiMac:bin xiaohong$ keytool -genkey -v -keystore android.keystore -alias android -keyalg RSA -validity  20000  -keystore /Users/xiaohong/android_demo.keystore
Enter keystore password: 
Re-enter  new  password:
What is your first and last name?
   [Unknown]:  Liu XiaoHong
What is the name of your organizational unit?
   [Unknown]:  www.xiaohong.com
What is the name of your organization?
   [Unknown]:  小红集团
What is the name of your City or Locality?
   [Unknown]: 上海
What is the name of your State or Province?
   [Unknown]:  上海市
What is the two-letter country code  for  this  unit?
   [Unknown]:   86
Is CN=Li XiaoHong, OU=www.xiaohong.com, O=小红集团, L=上海, ST=上海市, C= 86  correct?
   [no]:  Y
 
Generating  1 , 024  bit RSA key pair and self-signed certificate (SHA1withRSA) with a validity of  20 , 000  days
     for : CN=Liu XiaoHong, OU=www.xiaohong.com, O=小红集团, L=上海, ST=上海市, C= 86
Enter key password  for  <android>
     (RETURN  if  same as keystore password): 
[Storing /Users/xiaohong/android_demo.keystore]

5、到这里就可以到当前用户根目录下查看生产的keystore签名文件了



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值