Tauri mobile support is in alpha and you can check out the next branch to contribute or see the progress.
If you have Android Studio installed, it ships with a version of JDK so you don't have to install it manually. It is usually at <location of android studio installation>/jre
and can be used for JAVA_HOME
env var.
You can find it on Windows at C:\Program Files\Android\Android Studio\jre
Install it by running the following command based on your distro to install JDK:
Set the JAVA_HOME
env variable for this current shell (we will make it permanent later on)
JAVA_HOME
env:JAVA_HOME
env variable for this current shell (we will make it permanent later on)
There is two ways to install the SDK and NDK.
You can use the SDK Manager in Android Studio to install:
Note: you may need to tick
Show Package Details
in the right bottom corner to be abole to see some of these components
If you don't want or can't use Android Studio you can still get the SDK Manager CLI quite easily and use it to install other components.
Note: The SDK Manager is part of the "Command line tools only" that can be downloaded from here
Download the cmdline-tools
Install required SDK and NDK components
Download the cmdline-tools
Install required SDK and NDK components
Note: the location you moved the
cmdline-tools
directory into will be the location of your android SDK.
You'll need to set up some environment variables to get everything to work properly. The environment variables below should be all the ones your need to be able to use the Tauri CLI to build/run your Android app.
For WSL:
you also need to get ADB to connect to your emulator that is running on Windows
After updating .bashrc
either run source ~/.bashrc
or reopen your terminal to apply the changes.
Open a powershell instance and run the following commands in order
IMPORTANT: you need to reboot your Windows machine in order for the environement variables to be loaded correctly.
You should now have all the environment variables required and the cmdline-tools available in your PATH. You can verify this by running $env:ANDROID_ROOT\tools\latest\bin\sdkmanager
which should now be showing its help info.
Now lets bootstrap a project to develop a Tauri project for mobile.
Now you will need a Tauri application project. You can initialize one with create-tauri-app.
Tauri automatically runs the application on a connected device. If it cannot find one, it will prompt you to select an emulator to use.
cargo tauri android dev
cargo tauri ios dev
Devtools is automatically enabled on development and can be found on Chrome on Android development and on Safari on iOS development.
Open chrome://inspect/#devices
in Chrome to get the devtools window.
Open Safari > Develop > [Your Device Name] > [Your WebView].