码迷,mamicode.com
首页 > 移动开发 > 详细

Android 项目打包成apk文件

时间:2014-05-24 09:34:42      阅读:302      评论:0      收藏:0      [点我收藏+]

标签:android   style   class   blog   c   code   

首先,要利用Android SDK 自带的kdytool生成keystore文件:

keytool -genkey -alias android.keystore -keyalg RSA -validity 100000 -keystore android.keystore
参数意义:-validity主要是证书的有效期,写100000天;空格,退格键都算密码。

在DOS里面的过程:

bubuko.com,布布扣
(D:\Program Files\Java\jdk1.7.0_25\bin> keytool -genkey -alias android.keystore -keyalg RSA -validity 100000 -keystore android.keystore
输入keystore密码: android
您的名字与姓氏是什么?
[Unknown]: sxl
您的组织单位名称是什么?
[Unknown]: xs
您的组织名称是什么?
[Unknown]: xs
您所在的城市或区域名称是什么?
[Unknown]: null
您所在的州或省份名称是什么?
[Unknown]: null
该单位的两字母国家代码是什么
[Unknown]: null
CN=sxl, OU=xs, O=xuesheng, L=null, ST=null, C=null 正确吗?
[否] y
输入<android.keystore>的主密码
(如果和keystore密码相同,按回车):)
bubuko.com,布布扣
在Linux终端的过程
bubuko.com,布布扣
[liuaibin@centos6 ~]$ keytool -genkey -alias android.keystore -keyalg RSA -validity 100000 -keystore android.keystore
Enter keystore password:  
Re-enter new password: 
What is your first and last name?
  [Unknown]:  sxl
What is the name of your organizational unit?
  [Unknown]:  xs
What is the name of your organization?
  [Unknown]:  xs
What is the name of your City or Locality?
  [Unknown]:  null
What is the name of your State or Province?
  [Unknown]:  null
What is the two-letter country code for this unit?
  [Unknown]:  null
Is CN=sxl, OU=xs, O=xs, L=null, ST=null, C=null correct?
  [no]:  y

Enter key password for <android.keystore>
    (RETURN if same as keystore password):
bubuko.com,布布扣

 

第二,Eclipse Android生成apk文件

1、选择要打包的项目,右键点击–>Androidtools–>ExportSignedApplicationPackage…

2、选择打包的项目

3、选择生成的Eclipse Android.keystore文件并输入密码

4、选择aliaskey并输入密码

5、最后选择生成androidapk文件的目录及文件名

6、最终生成的apk文件

Android 项目打包成apk文件,布布扣,bubuko.com

Android 项目打包成apk文件

标签:android   style   class   blog   c   code   

原文地址:http://www.cnblogs.com/sigmon/p/3748765.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!