Getting Started
Goal: create a working iOS wrapper app for your PWA.
Prerequisites
- macOS 14+
- Xcode 15+
- Node.js 20+
- Internet connection (for template and manifest fetch)
1. Initialize project
bash
npx @pwa-kit/cli init my-pwa-iosThis is the normal user flow. The CLI downloads the template and configures it for your app.
Interactive wizard collects:
- Start URL (must be HTTPS)
- App name
- Bundle ID
- Optional allowed origins and feature toggles
What init does (from CLI implementation):
- Detects an existing
PWAKitApp.xcodeproj. - If not found, downloads latest template release.
- Fetches your web manifest (if available) for defaults.
- Writes
src/PWAKit/Resources/pwa-config.json. - Runs sync automatically.
2. Open and run in Xcode
bash
open my-pwa-ios/PWAKitApp.xcodeprojThen:
- Select a simulator (for example iPhone 16).
- Press
Cmd+R.
3. Verify bridge connectivity
ts
import { isNative, platform } from "@pwa-kit/sdk";
if (isNative) {
const info = await platform.getInfo();
console.log(info.platform, info.version, info.pwaKitVersion);
}4. Update config later
After manual edits to pwa-config.json, run:
bash
npx @pwa-kit/cli syncNext steps
- CLI details: CLI Overview
- Field-level config docs: Config Schema
- SDK references: SDK Overview
Working on PWAKit itself (SDK, CLI, iOS shell)? Clone this repository and use the
maketargets in the project root.
