用自定义keystore调试微信分享app

1、申请App_ID(这步略,去http://open.weixin.qq.com/app/list/?lang=zh_CN申请)

2、生产自己的key

Debug Key介绍

debug.keystore 在C盘下的.../.android/目录下,前面的路径根据电脑不同有所不同,一般开发时是用debug.keystore签名的;

debug.keystore的相关信息

Keystore name: “debug.keystore”
Keystore password: “android
Key alias: “androiddebugkey”
Key password: “android”
CN: “CN=Android Debug,O=Android,C=US”

发布key的生产

keytool -genkey -keystore abc.keystore -alias abc -keyalg RSA -validity 20000 (生产一个abc的keystore)

用发布key签名应用

右击工程,AndroidTools,Expore Signed Application Package,其余步骤顺着提示进行(个人认为这种方式简单)

在模拟器或真机上安装签名后的工程

3、填写应用签名

去http://open.weixin.qq.com/download/?lang=zh_CN下载apk;运行下载的apk,填写2步骤中签名工程的包名,点击“Get Signature”,会生产一串字符;这串字符就是要填写的应用签名

4、用自己创建的key 调试工程

因为要想向微信分享数据,必须用非debug Key对App进行签名,但是我们一般开发时使用的都是debug Key,那么如果用创建的abc keystore 对App签名,进而达到调试时就可以向微信分享数据。

在Window->Preferences->Android->Build->Custom debug keystore 选择abc keystore 会报错,当用自定义keystore进行调试时,必须保持自定义keystore的密码,别名,别名密码和debug keystore一样,所以我们要修改abc keystore 的一些信息

修改abc.keystore的别名:
keytool -changealias -keystore abc.keystore -alias abc -destalias androiddebugkey
修改abc.keystore的别名密码:
keytool -keypasswd -keystore abc.keystore -alias androiddebugkey
修改abc.keystore的密码:
keytool -storepasswd -keystore abc.keystore


Window->Preferences->Android->Build->Custom debug keystore 选择abc keystore ,就不会报错了,这样调试app时也可以向微信分享数据

你可能感兴趣的:(用自定义keystore调试微信分享app)