website/versioned_docs/version-v2.13.0/guides/mobile.mdx
:::danger EXPERIMENTAL Mobile support in Wails v3 is currently EXPERIMENTAL. The API and build process may change significantly before the final release. Use at your own risk in production environments. :::
Wails v3 introduces experimental support for building native mobile applications for iOS and Android platforms. This allows you to use the same Go codebase and web frontend across desktop and mobile platforms.
Mobile support enables you to build native iOS and Android applications using:
| Platform | WebView | Bridge Technology | Build Output |
|---|---|---|---|
| iOS | WKWebView | CGO (C headers) | .app / .ipa |
| Android | Android WebView | JNI | .apk |
:::warning macOS Required iOS development requires macOS with Xcode installed. :::
Android development is supported on macOS, Linux, and Windows.
Required Components:
Add these to your shell profile (~/.bashrc, ~/.zshrc, etc.):
# macOS
export ANDROID_HOME="$HOME/Library/Android/sdk"
# Linux
export ANDROID_HOME="$HOME/Android/Sdk"
# NDK (adjust version as needed)
export ANDROID_NDK_HOME="$ANDROID_HOME/ndk/29.0.14206865"
# Add tools to PATH
export PATH=$PATH:$ANDROID_HOME/platform-tools
export PATH=$PATH:$ANDROID_HOME/emulator
You can install the Android SDK through:
After installing, use SDK Manager to install:
# Build for iOS
task ios:build
# Build and run on simulator
task ios:run
# Build for device (requires code signing)
task ios:build:device
The build process will:
.a file)xcodebuild.app bundle (or .ipa for distribution)# Build for Android (default: arm64 for device)
task android:build
# Build for emulator (x86_64)
task android:build ARCH=x86_64
# Build for all architectures
task android:compile:go:all-archs
# Package APK
task android:package
# Run on emulator/device
task android:run
# View logs
task android:logs
The build process will:
.so file)iOS:
arm64 - iPhone 5s and later, all iPads with Apple SiliconAndroid:
| Architecture | Use Case | GOARCH |
|---|---|---|
| arm64-v8a | Modern devices (most common) | arm64 |
| x86_64 | Emulator | amd64 |
| armeabi-v7a | Older devices (optional) | arm |
| x86 | Older emulators (optional) | 386 |
app := application.New(application.Options{
Name: "My App",
iOS: application.IOSOptions{
// Disable bounce scroll effect
DisableBounce: true,
// Enable zoom gestures
EnableZoom: false,
// Custom user agent
UserAgent: "MyApp/1.0",
// Background color
BackgroundColour: application.NewRGB(255, 255, 255),
},
})
app := application.New(application.Options{
Name: "My App",
Android: application.AndroidOptions{
// Disable scrolling
DisableScroll: false,
// Disable overscroll bounce effect
DisableOverscroll: true,
// Enable pinch-to-zoom
EnableZoom: false,
// Custom user agent
UserAgent: "MyApp/1.0",
// Background color
BackgroundColour: application.NewRGB(255, 255, 255),
// Disable hardware acceleration (not recommended)
DisableHardwareAcceleration: false,
},
})
# List available simulators
xcrun simctl list devices
# Run on specific simulator
task ios:run SIMULATOR="iPhone 15 Pro"
# List available emulators
emulator -list-avds
# Start emulator
emulator -avd Pixel_7_API_34
# Install and run
task android:run
Your frontend JavaScript can detect the platform:
const platform = window.wails.System.Platform();
if (platform === 'ios') {
// iOS-specific code
} else if (platform === 'android') {
// Android-specific code
} else {
// Desktop code
}
:::warning Current Limitations The following features are not yet fully implemented on mobile platforms: :::
For detailed technical information about the mobile implementations:
ANDROID_ARCHITECTURE.md in the repositoryIOS_ARCHITECTURE.md in the repositoryThese documents provide comprehensive information about:
"Code signing required"
"Command Line Tools not found"
# Install Xcode Command Line Tools
xcode-select --install
"NDK not found"
# Verify NDK installation
ls $ANDROID_HOME/ndk
# Set NDK path explicitly
export ANDROID_NDK_HOME=$ANDROID_HOME/ndk/26.1.10909125
"UnsatisfiedLinkError: dlopen failed"
Blank WebView
chrome://inspect/#devicestask android:logs"cannot find package"
# Clear and rebuild Go modules
go clean -modcache
go mod tidy
go mod download
"CGO_ENABLED required"
# Ensure CGO is enabled
export CGO_ENABLED=1
Check out the example projects in the Wails repository:
v3/examples/ios/v3/examples/android/These examples demonstrate:
If you encounter issues with mobile support:
:::info Feedback Welcome Mobile support is actively being developed. Your feedback and bug reports are valuable for improving the implementation. Please share your experiences on GitHub or Discord! :::