Loading...
Loading...
Compare original and translation side by side
undefinedundefinedundefinedundefinedwinget install Rustlang.Rustup
rustup default stable-msvcwinget install Rustlang.Rustup
rustup default stable-msvcsudo apt update
sudo apt install libwebkit2gtk-4.1-dev build-essential curl wget file \
libxdo-dev libssl-dev libayatana-appindicator3-dev librsvg2-devsudo pacman -S webkit2gtk-4.1 base-devel curl wget file openssl \
appmenu-gtk-module libappindicator-gtk3 librsvg xdotoolsudo dnf install webkit2gtk4.1-devel openssl-devel curl wget file \
libappindicator-gtk3-devel librsvg2-devel libxdo-devel \
@development-toolssudo apt update
sudo apt install libwebkit2gtk-4.1-dev build-essential curl wget file \
libxdo-dev libssl-dev libayatana-appindicator3-dev librsvg2-devsudo pacman -S webkit2gtk-4.1 base-devel curl wget file openssl \
appmenu-gtk-module libappindicator-gtk3 librsvg xdotoolsudo dnf install webkit2gtk4.1-devel openssl-devel curl wget file \
libappindicator-gtk3-devel librsvg2-devel libxdo-devel \
@development-toolsundefinedundefinedundefinedundefinedundefinedundefined
Set environment variables: `JAVA_HOME`, `ANDROID_HOME`, `NDK_HOME`
**iOS (macOS only):**
```bash
设置环境变量:`JAVA_HOME`、`ANDROID_HOME`、`NDK_HOME`
**iOS(仅macOS):**
```bashundefinedundefinedundefinedundefined
**Prompts you'll see:**
1. Project name
2. Bundle identifier (e.g., `com.example.app`)
3. Frontend language: TypeScript/JavaScript, Rust, or .NET
4. Package manager
5. UI template: vanilla, Vue, Svelte, React, SolidJS, Angular, Preact, Yew, Leptos, Sycamore
**After scaffolding:**
```bash
cd your-project
npm install
npm run tauri dev
**你会看到的提示:**
1. 项目名称
2. 包标识符(例如:`com.example.app`)
3. 前端语言:TypeScript/JavaScript、Rust或.NET
4. 包管理器
5. UI模板:vanilla、Vue、Svelte、React、SolidJS、Angular、Preact、Yew、Leptos、Sycamore
**脚手架完成后:**
```bash
cd your-project
npm install
npm run tauri devundefinedundefined
**tauri init prompts:**
- App name
- Window title
- Frontend dev server URL (e.g., `http://localhost:5173`)
- Frontend build output directory (e.g., `dist`)
- Frontend dev command (e.g., `npm run dev`)
- Frontend build command (e.g., `npm run build`)
```bash
**tauri init提示项:**
- 应用名称
- 窗口标题
- 前端开发服务器URL(例如:`http://localhost:5173`)
- 前端构建输出目录(例如:`dist`)
- 前端开发命令(例如:`npm run dev`)
- 前端构建命令(例如:`npm run build`)
```bashundefinedundefinedmy-tauri-app/
├── package.json # Frontend dependencies
├── index.html # Frontend entry point
├── src/ # Frontend source code
│ └── main.js
└── src-tauri/ # Rust backend
├── Cargo.toml # Rust dependencies
├── Cargo.lock
├── build.rs # Tauri build script
├── tauri.conf.json # Main Tauri configuration
├── capabilities/ # Permission/capability definitions
├── icons/ # App icons (all formats)
└── src/
├── lib.rs # Main Rust code + mobile entry point
└── main.rs # Desktop entry pointmy-tauri-app/
├── package.json # Frontend dependencies
├── index.html # Frontend entry point
├── src/ # Frontend source code
│ └── main.js
└── src-tauri/ # Rust backend
├── Cargo.toml # Rust dependencies
├── Cargo.lock
├── build.rs # Tauri build script
├── tauri.conf.json # Main Tauri configuration
├── capabilities/ # Permission/capability definitions
├── icons/ # App icons (all formats)
└── src/
├── lib.rs # Main Rust code + mobile entry point
└── main.rs # Desktop entry point{
"productName": "my-app",
"version": "0.1.0",
"identifier": "com.example.my-app",
"build": {
"devUrl": "http://localhost:5173",
"frontendDist": "../dist"
},
"app": {
"windows": [{ "title": "My App", "width": 800, "height": 600 }]
}
}#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
tauri::Builder::default()
.run(tauri::generate_context!())
.expect("error while running tauri application");
}#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
fn main() {
app_lib::run();
}{
"identifier": "main-capability",
"windows": ["main"],
"permissions": ["core:default"]
}{
"productName": "my-app",
"version": "0.1.0",
"identifier": "com.example.my-app",
"build": {
"devUrl": "http://localhost:5173",
"frontendDist": "../dist"
},
"app": {
"windows": [{ "title": "My App", "width": 800, "height": 600 }]
}
}#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
tauri::Builder::default()
.run(tauri::generate_context!())
.expect("error while running tauri application");
}#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
fn main() {
app_lib::run();
}{
"identifier": "main-capability",
"windows": ["main"],
"permissions": ["core:default"]
}undefinedundefinedundefinedundefined| Template | Languages | Notes |
|---|---|---|
| vanilla | JS, TS | No framework |
| react | JS, TS | Vite-based |
| vue | JS, TS | Vite-based |
| svelte | JS, TS | Vite-based |
| solid | JS, TS | Vite-based |
| angular | TS | Angular CLI |
| preact | JS, TS | Vite-based |
| yew | Rust | Rust WASM frontend |
| leptos | Rust | Rust WASM frontend |
| sycamore | Rust | Rust WASM frontend |
| 模板 | 支持语言 | 说明 |
|---|---|---|
| vanilla | JS, TS | 无框架 |
| react | JS, TS | 基于Vite |
| vue | JS, TS | 基于Vite |
| svelte | JS, TS | 基于Vite |
| solid | JS, TS | 基于Vite |
| angular | TS | 基于Angular CLI |
| preact | JS, TS | 基于Vite |
| yew | Rust | Rust WASM前端 |
| leptos | Rust | Rust WASM前端 |
| sycamore | Rust | Rust WASM前端 |