update README

This commit is contained in:
polv committed 2026-03-27 10:30:26 +07:00
1 parent 37a397b98d
commit 58f951f9ee
3 files changed
+50 -6

No files matched your search

+47 -3
View File
@@ -2,9 +2,7 @@ Chinese grammar data manually copied and edited from <https://resources.allsetle
## How it works for Android
Using Tauri, it runs on Android even with dev server down, with `tauri android run`. (while no hot-reloading)
An extra CSS is needed for Android webview fix:-
Using Tauri, an extra CSS is needed for Android webview fix:-
```css
body {
@@ -14,3 +12,49 @@ body {
padding-right: env(safe-area-inset-right);
}
```
### Android without hot-reload
Tauri for Android target runs even with dev server down, with `tauri android run` (while no hot-reloading).
APK will be generated at `src-tauri/gen/android/app/build/outputs/apk/arm64/debug/app-arm64-debug.apk` which can be installed with
```sh
adb install -r src-tauri/gen/android/app/build/outputs/apk/arm64/debug/app-arm64-debug.apk
```
### Android hot-reload
When dev server is used, in addition to Android app won't work with dev server down, Firewall settings must also be allowed.
For Windows PowerShell,
```powershell
New-NetFirewallRule -DisplayName "Vitepress Server" -Direction Inbound -Protocol TCP -LocalPort 5173 -Action Allow
```
In addition, dev server needs to bind to `0.0.0.0` or `TAURI_DEV_HOST` env var.
```ts
import { defineConfig, MarkdownOptions } from "vitepress";
const host = process.env.TAURI_DEV_HOST;
// https://vitepress.dev/reference/site-config
export default defineConfig({
vite: {
server: {
port: 5173,
strictPort: true,
host: host || false,
hmr: host
? {
protocol: "ws",
host,
port: 5174,
}
: undefined,
},
},
});
```