分享一下 uniapp 打包安卓apk

首先需要安装 Java 环境,这里就不做解释了

第二步:打开 mac 终端 / cmd 命令行工具 使用keytool -genkey命令生成证书

keytool -genkey -alias testalias -keyalg RSA -keysize 2048 -validity 36500 -keystore test.keystore

*testalias 是证书别名,修改为自己想设置的字符,建议使用英文字母和数字

*test.keystore 是证书文件名称,可修改为自己想设置的文件名称,也可以指定完整文件路径

*36500 是证书的有效期,表示100年有效期,单位天,建议时间设置长一点,避免证书过期

回车后会提示:

Enter keystore password:

Unknown: //输入证书文件密码,输入完成回车

Re-enter new password:

Unknown: //再次输入证书文件密码,输入完成回车

What is your first and last name?

Unknown: //输入名字和姓氏,输入完成回车

What is the name of your organizational unit?

Unknown: //输入组织单位名称,输入完成回车

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: //输入国家/地区代号(两个字母),中国为CN,输入完成回车

Is CN=XX, OU=XX, O=XX, L=XX, ST=XX, C=XX correct?

no: //确认上面输入的内容是否正确,输入y,回车

Enter key password for <testalias>

(RETURN if same as keystore password): //确认证书密码与证书文件密码一样(HBuilder|HBuilderX要求这两个密码一致),直接回车就可以

查看证书信息:

keytool -list -v -keystore test.keystore

Enter keystore password: //输入密码,回车

然后,打开 uniapp 点 发行 =》原生App,云打包

点打包就可以,排队等打包完成就行,打包完成后

在该目录下有个apk文件:

/项目根目录/unpackage/release/apk

相关推荐
游戏开发爱好者81 天前
系统状态:专为iPhone和iPad设计的实时系统性能监控工具全面介绍
android·ios·小程序·uni-app·iphone·webview·ipad
2501_915909061 天前
全面解析iOS应用上架到App Store的完整流程与关键注意事项
android·macos·ios·小程序·uni-app·cocoa·iphone
2501_915106322 天前
iOS 证书类型及作用说明 账号证书与签名配置的完整解读
android·ios·小程序·https·uni-app·iphone·webview
2501_916008893 天前
移动安全之 APP 加固,保障移动应用安全的重要手段
安全·macos·ios·小程序·uni-app·iphone·xcode
2501_915106323 天前
Python爬虫从零开始:七天掌握HTTP协议、数据解析与反爬策略
android·ios·小程序·https·uni-app·iphone·webview
90后的晨仔3 天前
uni-app 项目目录结构全解:每个文件、每个文件夹的作用与配置详解
vue.js·uni-app
爱看老照片3 天前
关于uniapp中单位rpx的注意点
uni-app·rpx
郑州光合科技余经理3 天前
代驾系统架构拆解:订单链路、权限组织与私有化源码交付
开发语言·后端·算法·架构·系统架构·uni-app·php
2501_915921434 天前
详细解析,iOS 应用上架 App Store 的完整流程与指南
android·ios·小程序·https·uni-app·iphone·webview
2501_915918414 天前
Xcode调试iOS应用内存管理与优化,识别泄漏与性能监控指南
android·ios·小程序·uni-app·cocoa·iphone·xcode