Skip to Content

iOS

Attach conciv to a native iOS app running in the simulator.

conciv for iOS floats the widget over your native app in the simulator. A web dev server runs the engine and serves the widget.

Early alpha

The Swift API can change without notice. The iOS simulator is the only supported target.

Prefer to let your agent do it?

Copy this prompt into your coding agent. It sets up the dev server and the Swift package for you.

Set up conciv in this project. conciv is a dev-only AI agent widget for my running app.

1. In my app folder, the one with package.json, run `npx @conciv/cli@latest init --yes`, with pnpm dlx, yarn dlx or bunx instead of npx if the project uses that package manager. Do any step it prints as a snippet yourself. If it stops on uncommitted changes or the install fails, stop and ask me; do not pass --force or change a release age policy yourself.
2. Check that init added conciv() to the plugins of my Vite config.
3. Check that the claude CLI is installed, logged in and on the PATH of the shell that starts the dev server. conciv does not install it or log in; if it is missing, tell me.
4. Start the dev server with my dev script and open the app. A conciv button shows in the corner. Log me in: run `npx @conciv/cli@latest auth link <the app URL>` in the app folder and give me the link it prints, or tell me to click the conciv button and type the 6-digit code the dev server prints.

Attach conciv to your app

First set up a web dev server with conciv, as on the Vite page, and start it. The app loads the widget from the engine that server runs.

In Xcode, use File > Add Package Dependencies and paste this URL:

Package URL
https://github.com/conciv-dev/conciv-swift.git

Pick the version that matches your @conciv/it version. Add the ConcivWidget product to the target that shows your UI. The package needs iOS 17.

Call attach() once at app start:

MyApp.swift
import SwiftUI
import ConcivWidget

@main
struct MyApp: App {
  init() { 
    ConcivWidget.attach() 
  } 

  var body: some Scene {
    WindowGroup {
      ContentView()
    }
  }
}

attach() finds the key window and the engine itself, so App.init is early enough. Build and run a Debug build in the simulator. Tap the conciv button and type the 6-digit code your dev server prints.

What works

  • The chat and the panel over your own UI.
  • Pick mode, which hands a native view to the agent.
  • A Release build shows no widget.
  • A Swift edit reaches the screen only after a build and a run. There is no hot reload.

Let the agent build and run the app

Add the iOS plugin to the plugins of your conciv config. The engine installs it from npm, so there is nothing to install:

vite.config.ts
import {} from 'vite'
import  from '@conciv/it/plugin/vite'

export default ({
  : [
    ({
      : [['@conciv/plugin-ios', {: './ios', : 'com.example.MyApp'}]], 
    }),
  ],
})
  • projectRoot is the folder of your Xcode project, relative to the dev server.
  • bundleId is the bundle id the agent installs and launches.

The agent then gets four tools, named ios_*: build, run, screenshot and logs. The first two ask you first, with a Permission card. Without options, every tool answers that the plugin is not configured.

Next steps

On this page