GithubHelp home page GithubHelp logo

johannesmerkt / tauri-alpha-mobile-android-react-template Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 229 KB

Try out Tauri Mobile for Android with this template. The frontend is using Vite + Typescript + React

HTML 6.17% Rust 21.85% CSS 29.13% TypeScript 42.85%

tauri-alpha-mobile-android-react-template's Introduction

Tauri Alpha for Desktop & Android + React + Typescript

This template should help get you started trying out Tauri for Android. I have not tested this project for IOS, feel free to try and contribute your changes here :)

Recommended IDE Setup

Prerequisites

https://beta.tauri.app/2/guide/prerequisites/

Windows: With Visual Studio Installer install Visual Studio 2022 with Desktop development with C++ selected.

Install Nodejs

Install yarn

Install Rust with rustup

Add rustup targets:

rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android

Install Android Studio

Start Android Studio and go to settings and search for Android SDK

There install:

  • An android SDK Platform
  • Android SDK Platform-Tools
  • NDK (Side by side)
  • Android SDK Build-Tools
  • Android SDK Command-line Tools

Set Environment Variables:

  • JAVA_HOME => C:\Program Files\Android\Android Studio\jbr
  • ANDROID_HOME => $env:LocalAppData\Android\Sdk
  • NDK_HOME => $env:LocalAppData\Android\Sdk\ndk\25.0.8775105

Install tauri-cli:

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

Usage

create android project with:

yarn tauri android init

Start in dev mode with (only works when no android device is connected in emulator mode!!!):

yarn tauri android dev

Building

yarn tauri android build

Then the build app must be signed.

Create a key to sign the android app

keytool -genkey -v -keystore ./src-tauri/gen/android/release-keystore.jks -alias alias_name -keyalg RSA -keysize 2048 -validity 10000

Now sign the app

& $env:ANDROID_HOME/build-tools/34.0.0/apksigner sign --ks ./src-tauri/gen/android/release-keystore.jks ./src-tauri/gen/android/app/build/outputs/apk/universal/release/app-universal-release-unsigned.apk

You can find the build app under:

./src-tauri/gen/android/app/build/outputs/apk/universal/release/app-universal-release-unsigned.apk

Helpful Resources to get started with tauri for andriod

tauri-alpha-mobile-android-react-template's People

Contributors

johannesmerkt avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.