hhstore / blog

My Tech Blog: about Mojo / Rust / Golang / Python / Kotlin / Flutter / VueJS / Blockchain etc.
https://github.com/hhstore/blog/issues
294 stars 24 forks source link

Tauri: a framework that allows you to build cross-platform apps #408

Open hhstore opened 1 year ago

hhstore commented 1 year ago

📖 Abstract:

💯 Related:

hhstore commented 1 year ago

Tauri: 跨平台 app 开发框架

适用场景:

核心优势:

势能:

原理:

对比 electron/react-native:

对比 flutter:

hhstore commented 1 year ago

v2 初始化:

准备工作:

安装 cli:

v2:


cargo install tauri-cli --version "^2.0.0-alpha"

cargo tauri -h

# 查看版本:
cargo tauri -V

# 初始化:
cargo tauri init
# 添加依赖:
yarn add -D @tauri-apps/cli@next
yarn add @tauri-apps/api@next

# 依赖:
yarn add -D internal-ip
pnpm add -D internal-ip

# 初始化项目: 生成 tauri 目录
yarn tauri init

v1:

pnpm add -D @tauri-apps/cli
yarn add -D @tauri-apps/cli

# 初始化:
yarn tauri init

初始化 mobile app 目录:


# 小坑: 要设置环境变量:
TAURI_APPLE_DEVELOPMENT_TEAM="a24z" cargo tauri ios init
TAURI_APPLE_DEVELOPMENT_TEAM="a24z" cargo tauri android init

# iOS:
pnpm tauri ios init
yarn tauri ios init

# Android:
pnpm tauri android init
yarn tauri android init

本地运行+调试:


# iOS:
yarn tauri ios dev [--open]

# Android
yarn tauri android dev [--open]

yarn tauri ios build
yarn tauri android build
hhstore commented 1 year ago

1

hhstore commented 1 year ago

1

hhstore commented 1 year ago

1

hhstore commented 1 year ago

1

hhstore commented 1 year ago

1

hhstore commented 1 year ago

1