zoukankan      html  css  js  c++  java
  • Android 项目打包成apk文件

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

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

    在DOS里面的过程:

    (D:Program FilesJavajdk1.7.0_25in> 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密码相同,按回车):)
    在Linux终端的过程
    [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):

    第二,Eclipse Android生成apk文件

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

    2、选择打包的项目

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

    4、选择aliaskey并输入密码

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

    6、最终生成的apk文件

  • 相关阅读:
    程序员职业规划
    SSH框架优缺点
    Servlet的生命周期,并说出Servlet和CGI的区别,Servlet与JSP的区别
    什么是J2EE,包括哪些规范!
    JS中定义类的方法
    audio.js – 随时随地,播放 HTML5 的声音
    jquery面试题里 缓存问题如何解决?
    产生一个int数组,长度为100,并向其中随机插入1-100,并且不能重复
    JAVA排序算法
    java面试题中常见的关于String类问题总结
  • 原文地址:https://www.cnblogs.com/sigmon/p/3748765.html
Copyright © 2011-2022 走看看