Skip to main content

Getting Started

Get your first Drift app running in three steps.

Prerequisites

  • Go 1.24 or later
  • Android: Android SDK, NDK, Java 17+, and environment variables:
    export ANDROID_HOME=/path/to/android/sdk
    export ANDROID_NDK_HOME=$ANDROID_HOME/ndk/<version>
  • iOS: macOS with Xcode (or Linux with xtool)

1. Install the CLI

go install github.com/go-drift/drift/cmd/drift@latest

Make sure $(go env GOPATH)/bin or GOBIN is on your PATH so the drift command is available.

2. Create a Project

drift init hello-drift
cd hello-drift

This creates:

  • main.go - Your app entry point
  • go.mod - Go module file

The generated main.go:

package main

import (
"github.com/go-drift/drift/pkg/core"
"github.com/go-drift/drift/pkg/drift"
"github.com/go-drift/drift/pkg/widgets"
)

func main() {
drift.NewApp(App()).Run()
}

func App() core.Widget {
return widgets.Centered(
widgets.Text{Content: "Hello, Drift!"},
)
}

3. Run Your App

drift run android
# or
drift run ios --simulator "iPhone 17"
# or
drift run xtool

Skia binaries are downloaded automatically on first run.

Configuration

Customize your app with drift.yaml:

app:
name: Hello Drift
id: com.example.hellodrift

engine:
version: latest

CLI Commands

CommandDescription
drift init <name>Create a new project
drift run androidRun on Android device/emulator
drift run iosRun on iOS device
drift run ios --simulator "iPhone 17"Run on iOS simulator
drift run xtoolRun iOS from Linux via xtool
drift build android|ios|xtoolBuild without running
drift cleanClear build cache
drift fetch-skiaDownload Skia binaries manually

Next Steps