Open a terminal/command prompt and run:
rustup target add aarch64-pc-windows-msvcYou need Visual Studio with ARM64 support:
- Install Visual Studio 2022 (Community edition is fine)
- During installation, select:
- Desktop development with C++
- MSVC v143 - VS 2022 C++ ARM64/ARM64EC build tools
- Windows 11 SDK (10.0.22000.0 or later)
# Check if ARM64 target is installed
rustup target list | findstr aarch64-pc-windows-msvc
# Should show: aarch64-pc-windows-msvc (installed)The vcvarsall.bat script accepts different parameters for different build scenarios:
x64- Build x64 apps on x64 hostx86- Build x86 appsx64_arm64- Build ARM64 apps on x64 host (cross-compilation)x64_arm- Build ARM apps on x64 hostarm64- Build ARM64 apps on ARM64 host (native)
For building ARM64 apps on a regular x64 Windows machine, use x64_arm64.
Verify your build script is configured correctly:
{
"scripts": {
"app:build:windows:arm": "tauri build --target aarch64-pc-windows-msvc"
}
}You need to configure the Visual Studio build tools for ARM64 cross-compilation:
Option A: Using vcvarsall.bat (Recommended) Open a regular Command Prompt and run:
"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" x64_arm64Note: The path might be different based on your Visual Studio installation:
- Build Tools:
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvarsall.bat
After running this command, you should see:
**********************************************************************
** Visual Studio 2022 Developer Command Prompt v17.x.x
** Copyright (c) 2022 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64_arm64'
Option B: Using Developer Command Prompt Alternatively, open "x64_arm64 Cross Tools Command Prompt for VS 2022" from Start Menu.
In the same command prompt window (after running vcvarsall.bat):
Command Prompt:
set TAURI_PRIVATE_KEY=....your-full-key-here# Remove old build artifacts
npm run clean
# or manually
rmdir /s /q src-tauri\target# Ensure all dependencies are installed
npm install
cd src-tauri
cargo update
cd ..Run your build command:
npm run app:build:windows:armThe build process will:
- Compile Rust code for ARM64
- Build the frontend
- Package everything into an installer
Expected output:
Compiling your-app v0.1.0 (src-tauri)
Finished release [optimized] target(s) in X.XXs
Bundling your-app_0.1.0_arm64-setup.exe
Bundling your-app_0.1.0_arm64.msi
Finished 2 bundles
# Fix: Install the target
rustup target add aarch64-pc-windows-msvcSolution: Set up the build environment properly:
# Run this first:
"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" x64_arm64
# Then try building again
npm run app:build:windows:armAlternative fixes:
- Ensure Visual Studio ARM64 tools are installed
- Restart your terminal after VS installation
- Use the correct vcvarsall.bat path for your VS edition
# Ensure your private key is set correctly
echo %TAURI_PRIVATE_KEY% # Should show your keyAdd to src-tauri/.cargo/config.toml:
[build]
jobs = 2 # Reduce parallel jobs
[target.aarch64-pc-windows-msvc]
linker = "lld-link.exe" # Use faster linkerFor best results, use one of these methods:
Method 1: Using vcvarsall.bat (Flexible)
# Open regular Command Prompt, then run:
"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" x64_arm64Why use vcvarsall.bat?
- Sets up all necessary paths for ARM64 cross-compilation
- Configures the linker and compiler for x64 to ARM64 builds
- Ensures all Visual Studio tools are available in PATH
After successful build, check:
src-tauri\target\aarch64-pc-windows-msvc\release\bundle\
├── msi\
│ └── YourApp_0.1.0_arm64.msi
└── nsis\
└── YourApp_0.1.0_arm64-setup.exe
# Full build sequence
rustup target add aarch64-pc-windows-msvc
# Set up build environment (use your VS path)
"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" x64_arm64
# Set environment variables
set TAURI_PRIVATE_KEY=your-key-here
# Build
npm install
npm run app:build:windows:armrustup target add aarch64-pc-windows-msvc && "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" x64_arm64 && set TAURI_PRIVATE_KEY=your-key-here && npm install && npm run app:build:windows:arm