-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Add native support for desktop and android (Tauri) #4379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 8 commits
Commits
Show all changes
55 commits
Select commit
Hold shift + click to select a range
88877ec
Add initial Tauri v2 support
haslinghuis 48c2b5a
Add native tauri check
haslinghuis 42aeeec
Add Tauri v2 shell:allow-open capability
haslinghuis acd61f4
Update
haslinghuis 84ede3c
Add DockerFile (needs testing)
haslinghuis 4902890
Update edition
haslinghuis f151b51
Update DOCKER.MD
haslinghuis 0054921
Fix app security capabilities
haslinghuis a3306b8
Fix outdated versions
haslinghuis 03cac08
Fix shell open
haslinghuis c92fa42
Add android commands
haslinghuis 4853c58
Use yarn for docker
haslinghuis d77ffcd
Use cargo
haslinghuis 7522fcd
Fix yarn tauri:android:dev
haslinghuis 35c46eb
isTauri does not work with Android
haslinghuis a101a60
Update path for ADB
haslinghuis 7f512d1
Use run-script-os
haslinghuis 387e73e
Fix HMR on android
haslinghuis 2405e8c
Remove redundant alias
haslinghuis f9d0229
Avoid device offline races
haslinghuis e5cbca7
👾
haslinghuis 9b4b089
add equivalent boot completion check to Windows version
haslinghuis 033ed2d
Fix sonar
haslinghuis f11154a
Nitpicks
haslinghuis 456d03b
Added support for tauriserial
haslinghuis 0fa4034
Added support for tauriserial II
haslinghuis a34720e
Update DOCKER.md
haslinghuis 7a0c83a
Update
haslinghuis b202a7a
Fix broken pipe, reconnect, unplug
haslinghuis 8f425c3
Fix some sonar issues
haslinghuis 3fda9fe
Coderabbit refactoring
haslinghuis 78b8c8e
Use function not object
haslinghuis 6b83cb1
Fix race condition
haslinghuis 7d8e682
Remove deadcode after refactoring
haslinghuis 3203205
Fix some more sonar issues but not all
haslinghuis 794e516
cargo update
haslinghuis 219fb67
ci: simplify to node-only, add workflow_dispatch test wrapper
haslinghuis 73ebf07
release: add Tauri desktop builds (dmg/nsis/deb/appimage) and optiona…
haslinghuis 8cc5564
release: always build Android APK; setup Android SDK and cache Gradle…
haslinghuis 2b37847
ci: run on pull_request and push; upload web-dist artifact to PR; gua…
haslinghuis b2ec264
ci: add Tauri Linux preview job to build and upload .deb/.AppImage on…
haslinghuis 65ea802
ci: fix Tauri Linux preview by installing required Linux deps (webkit…
haslinghuis beaa32d
CI: fix Tauri Linux preview by building web assets and set correct CW…
haslinghuis 09c745e
Fix tauri.conf.json schema error: remove unsupported *Cwd keys; run w…
haslinghuis 1e47dde
CI: run Tauri before* commands at repo root (remove `cd ..`) to fix p…
haslinghuis 6001931
Rust
haslinghuis f29dc9e
CI+Tauri: point frontendDist to ../src/dist and upload correct web ar…
haslinghuis 48c5254
CI: fix Tauri action invocation (use `yarn tauri` so action appends `…
haslinghuis f25d3d2
CI(Linux): install pkg-config, libudev-dev, and libssl-dev to satisfy…
haslinghuis b3f3259
Publish
haslinghuis 6873847
Remove fallback
haslinghuis 1647074
Fix artifact-links workflow: trigger on "CI" workflow instead of non-…
haslinghuis b7cf233
Fix artifact-links: only run when CI was triggered by pull_request (s…
haslinghuis cbbdcf2
Add permissions to artifact-links workflow (pull-requests: write, act…
haslinghuis 56f2783
Rewrite artifact-links workflow with github-script for better reliabi…
haslinghuis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| # 🐳 Development Environment with Docker | ||
|
|
||
| To ensure all developers use a consistent environment, especially for cross-platform compilation (Rust, Node.js, Android SDK/NDK), we provide a Dockerfile. | ||
|
|
||
| ## 1. Build the Docker Image | ||
|
|
||
| Build the container image from the Dockerfile in the project root. This process will download all system dependencies, the Rust toolchain, and the Android SDK/NDK. | ||
|
|
||
| ```bash | ||
| docker build -t betaflight-tauri-dev . | ||
| ``` | ||
|
|
||
| ## 2. Run the Development Container | ||
|
|
||
| Run the image and mount your local project directory into the container's /app directory. This allows you to work on your code locally while running all build commands inside the isolated Docker environment. | ||
|
|
||
| ```bash | ||
| docker run -it --rm \ | ||
| -v $(pwd):/app \ | ||
| --name betaflight-dev-container \ | ||
| betaflight-tauri-dev | ||
|
|
||
| -it: Runs the container in interactive mode with a TTY (shell access). | ||
|
|
||
| --rm: Automatically removes the container when you exit. | ||
|
|
||
| -v $(pwd):/app: Mounts your current directory (the project root) to the /app working directory in the container. | ||
| ``` | ||
|
|
||
| ## 3. Execute Build/Dev Commands | ||
|
|
||
| Once inside the container's terminal, you can run any of the Tauri commands without needing to worry about local prerequisites. | ||
|
|
||
| Command | Purpose | ||
| --- | --- | ||
| bun install | Installs the frontend dependencies. | ||
| bun tauri dev | Runs the desktop development server. | ||
| bun tauri android dev | Runs the app on a connected Android device or emulator (must be running outside of the container). | ||
| bun tauri android build | Builds a release APK for Android. | ||
|
|
||
| You may need to start an Android emulator on your host machine before running bun tauri android dev. | ||
|
|
||
| You can watch this video for a practical demonstration of setting up a dev container for Tauri and Android development. | ||
| https://www.youtube.com/watch?v=X3EThnruPA4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| # Use a base image that supports the necessary build tools | ||
| FROM debian:bookworm-slim | ||
|
|
||
| # Set environment variables for non-interactive installs and Android components | ||
| # You may need to update these versions over time | ||
| ENV DEBIAN_FRONTEND=noninteractive | ||
| ENV RUSTUP_HOME=/usr/local/rustup \ | ||
| CARGO_HOME=/usr/local/cargo \ | ||
| ANDROID_SDK_ROOT=/usr/local/android-sdk \ | ||
| NDK_VERSION=26.3.11579204 \ | ||
| SDK_PLATFORM_VERSION=34 \ | ||
| SDK_BUILD_TOOLS_VERSION=34.0.0 | ||
| ENV PATH=$CARGO_HOME/bin:$ANDROID_SDK_ROOT/cmdline-tools/latest/bin:$PATH | ||
|
|
||
| # --- Install System Dependencies (Rust, Node.js, and Build Tools) --- | ||
| RUN apt-get update && \ | ||
| apt-get install -y --no-install-recommends \ | ||
| curl \ | ||
| wget \ | ||
| xz-utils \ | ||
| unzip \ | ||
| git \ | ||
| build-essential \ | ||
| libwebkit2gtk-4.1-dev \ | ||
| libssl-dev \ | ||
| libayatana-appindicator3-dev \ | ||
| librsvg2-dev \ | ||
| libxdo-dev \ | ||
| # Dependencies for Android build targets (needed for the linker) | ||
| clang \ | ||
| llvm \ | ||
| g++-multilib \ | ||
| openjdk-17-jdk \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| # Install Rust | ||
| RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable | ||
|
|
||
| # Add Rust targets for Android | ||
| RUN $CARGO_HOME/bin/rustup target add \ | ||
| aarch64-linux-android \ | ||
| armv7-linux-androideabi \ | ||
| i686-linux-android \ | ||
| x86_64-linux-android | ||
|
|
||
| # Install a Node.js runtime (e.g., Bun, or use Node/NPM if preferred) | ||
| # Replace this section with your preferred runtime installation (npm, yarn, pnpm) | ||
| RUN curl -fsSL https://bun.sh/install | bash | ||
| ENV PATH="/root/.bun/bin:$PATH" | ||
|
|
||
| # --- Install Android SDK/NDK --- | ||
| # Download the Android SDK command line tools | ||
| RUN mkdir -p $ANDROID_SDK_ROOT/cmdline-tools && \ | ||
| wget -q https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip -O cmdline-tools.zip && \ | ||
| unzip -q cmdline-tools.zip -d $ANDROID_SDK_ROOT/cmdline-tools && \ | ||
| mv $ANDROID_SDK_ROOT/cmdline-tools/cmdline-tools $ANDROID_SDK_ROOT/cmdline-tools/latest && \ | ||
| rm cmdline-tools.zip | ||
|
|
||
| # Accept licenses and install platform tools, platforms, and NDK | ||
| RUN yes | sdkmanager --licenses && \ | ||
| sdkmanager \ | ||
| "platform-tools" \ | ||
| "platforms;android-${SDK_PLATFORM_VERSION}" \ | ||
| "build-tools;${SDK_BUILD_TOOLS_VERSION}" \ | ||
| "ndk;${NDK_VERSION}" | ||
|
|
||
| # Set the NDK_HOME environment variable | ||
| ENV NDK_HOME=$ANDROID_SDK_ROOT/ndk/${NDK_VERSION} | ||
|
|
||
| # Create a non-root user and set it as the working user | ||
| # This is a security best practice | ||
| RUN useradd -ms /bin/bash developer && chown -R developer:developer /usr/local/ | ||
| USER developer | ||
| WORKDIR /app | ||
|
|
||
| # The ENTRYPOINT should be set to your shell to allow running commands | ||
| ENTRYPOINT ["/bin/bash"] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.