iOS
此内容尚不支持你的语言。
Wails v3 applications run on iOS as native UIKit apps: a WKWebView renders
the frontend, assets are served in-process over a custom wails:// URL
scheme (no localhost server, no open ports), and the standard
@wailsio/runtime works unchanged — service bindings, events, dialogs and
the clipboard use the same /wails/runtime transport as on desktop.
The same main.go builds for desktop and iOS. iOS-specific behaviour is
configured through application.Options.IOS, with per-platform Go files
guarded by //go:build ios.
Requirements
Section titled “Requirements”- macOS with full Xcode installed (the command-line tools alone are not
enough) —
wails3 doctorshows the iOS SDKs it can find - Go 1.24+ and npm
Running on the Simulator
Section titled “Running on the Simulator”From your project directory:
wails3 task ios:runThis generates the iOS scaffolding (build/ios/), compiles your Go code as
a C archive (GOOS=ios), links it against UIKit, bundles, signs ad-hoc,
boots a simulator if necessary, and launches the app.
Useful companions:
wails3 task ios:logs:dev # stream the app's logs from the simulatorwails3 task ios:xcode # open the generated Xcode projectIn debug builds the webview is inspectable from Safari’s Develop menu.
Packaging
Section titled “Packaging”wails3 task ios:package # production .app for the simulatorwails3 task ios:deploy-simulator # install + launch itProduction builds use -tags production,ios, are stripped, and compile out
the framework’s internal diagnostics.
Device builds
Section titled “Device builds”wails3 task ios:package IOS_PLATFORM=device \ CODESIGN_IDENTITY="Apple Development: You (TEAMID)" \ PROVISIONING_PROFILE=path/to/profile.mobileprovision
wails3 task ios:deploy-device [DEVICE_ID=<udid>] # via xcrun devicectlwails3 task ios:package:ipa IOS_PLATFORM=device ... # distribution .ipaIOS_PLATFORM=device selects the iphoneos SDK and the
arm64-apple-ios<min> target. Entitlements from
build/ios/entitlements.plist are applied to device builds only —
get-task-allow by default; add capability keys as your app needs them.
Configuration
Section titled “Configuration”build/config.yml:
ios: bundleID: com.example.myapp displayName: My App version: 1.0.0 minIOSVersion: "15.0"Application options (application.Options.IOS) include DisableScroll,
DisableBounce, DisableScrollIndicators, DisableInputAccessoryView,
EnableBackForwardNavigationGestures, DisableLinkPreview,
EnableInlineMediaPlayback, EnableAutoplayWithoutUserAction,
DisableInspectable, UserAgent, ApplicationNameForUserAgent,
BackgroundColour, and native bottom tabs via EnableNativeTabs +
NativeTabsItems.
The frontend can drive iOS features at runtime through the IOS runtime
object — IOS.Haptics.Impact(style), IOS.Device.Info(),
IOS.Scroll.SetEnabled(...) — and native tab selections arrive as a
nativeTabSelected CustomEvent on window.
What works, what doesn’t
Section titled “What works, what doesn’t”| Area | Status |
|---|---|
WKWebView + in-process assets (wails://) | ✅ |
| Service bindings, events (both directions) | ✅ |
| Message dialogs | ✅ UIAlertController with button callbacks |
| Open file / files / directory dialogs | ✅ UIDocumentPicker (files imported as sandbox copies) |
| Save file dialogs | ❌ Returns an error — write inside the app sandbox instead |
| Clipboard | ✅ UIPasteboard |
| Screens API | ✅ UIScreen metrics incl. safe-area work area |
Lifecycle events (events.IOS.*) | ✅ |
| Window geometry, menus, system tray | Intentional no-ops |
| Multiple windows | Only the first window is displayed |
Porting notes
Section titled “Porting notes”- Desktop code compiles unchanged under
GOOS=ios; geometry/menu/tray calls become no-ops because iOS apps are fullscreen. iosimplies thedarwinbuild tag: macOS-only files need//go:build darwin && !ios, and at runtimeruntime.GOOSis"ios".- Replace save-file dialogs with writes into the app sandbox (for example the Documents directory) plus a share flow.
- Design the frontend responsively; safe areas are handled natively.