说明:此方法适用在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.keystoreEnter
keystore password: Re-enter new password:What
is your first and last name? [Unknown]:
Liu XiaoHongWhat
is the name of your organizational unit? [Unknown]:
www.xiaohong.comWhat
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]: 86Is
CN=Li XiaoHong, OU=www.xiaohong.com, O=小红集团, L=上海,
ST=上海市, C=86 correct? [no]:
YGenerating 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=86Enter
key password for <android> (RETURN if same
as keystore password): [Storing
/Users/xiaohong/android_demo.keystore]
5、到这里就可以到当前用户根目录下查看生产的keystore签名文件了

本文介绍如何在MAC系统中使用终端生成Keystore签名文件,包括进入Java安装目录、生成签名文件的具体命令及参数说明。
9888

被折叠的 条评论
为什么被折叠?



