Skip to content

Commit 21ddcb5

Browse files
doc: update docs/tauri.md (#618)
1 parent ac70a8d commit 21ddcb5

File tree

1 file changed

+36
-1
lines changed

1 file changed

+36
-1
lines changed

docs/tauri.md

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ $ bunx create-tauri-app
4343
:- |:-
4444
[rust](https://www.rust-lang.org/tools/install)| rust安装
4545
[nodejs](https://nodejs.org/en)| nodejs安装
46-
[Build Tools](https://visualstudio.microsoft.com/zh-hans/visual-cpp-build-tools/)| Microsoft C++ 生成工具 (for windows)
46+
[Windows Build Tools](https://visualstudio.microsoft.com/zh-hans/visual-cpp-build-tools/)| Microsoft C++ 生成工具 (for windows)
47+
[Android Studio](https://developer.android.google.cn/studio?hl=zh-cn)|安卓开发工具
4748

4849
### 启动 Tauri 开发窗口
4950

@@ -152,6 +153,40 @@ tauri = { version = "...", features = ["...", "devtools"] }
152153

153154
在文件 `src-tauri/Cargo.toml` 中启用 `devtools Cargo` 功能
154155

156+
安卓开发
157+
---
158+
### 环境变量
159+
<!--rehype:wrap-class=col-span-2-->
160+
`JAVA_HOME`
161+
162+
`ANDROID_HOME`
163+
164+
`NDK_HOME`
165+
### 准备目标
166+
<!--rehype:wrap-class=col-span-2-->
167+
168+
```bash
169+
$ npm install @tauri-apps/cli@next @tauri-apps/api@next
170+
$ npm run tauri migrate
171+
$ rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android
172+
$ rm -r src-tauri/gen
173+
$ npm run tauri android init
174+
$ npm run tauri icon
175+
```
176+
修改应用名:%app_path%\src-tauri\gen\android\app\src\main\res\values\strings.xml
177+
### 编译
178+
<!--rehype:wrap-class=col-span-2-->
179+
```bash
180+
$ npm run tauri android dev
181+
$ npm run tauri android build
182+
```
183+
### 签名
184+
<!--rehype:wrap-class=col-span-2-->
185+
```bash
186+
$ keytool -genkey -alias android.keystore -keyalg RSA -validity 20000 -keystore android.keystore
187+
$ zipalign -p -f -v 4 unsigned.apk release.apk
188+
$ apksigner sign --ks android.keystore release.apk
189+
```
155190
配置
156191
---
157192

0 commit comments

Comments
 (0)