Run a virtual iPhone on an Apple Silicon Mac.
Swift
Add Install Skill to Host Setup and bundle the skill into Launchpad
Lakr67d0734a6f5e
diff --git a/VPhoneLaunchpad/VPhoneLaunchpad.xcodeproj/project.pbxproj b/VPhoneLaunchpad/VPhoneLaunchpad.xcodeproj/project.pbxprojindex 54d00b56..5ff75e48 100644--- a/VPhoneLaunchpad/VPhoneLaunchpad.xcodeproj/project.pbxproj+++ b/VPhoneLaunchpad/VPhoneLaunchpad.xcodeproj/project.pbxproj@@ -8,6 +8,7 @@5A1000000000000000000061 /* com.vphone.launchpad.helper in Embed Privileged Helper */ = {isa = PBXBuildFile; fileRef = 5A1000000000000000000032 /* com.vphone.launchpad.helper */; };5A1000000000000000000062 /* GhosttyTerminal in Frameworks */ = {isa = PBXBuildFile; productRef = 5A10000000000000000000B1 /* GhosttyTerminal */; };5A10000000000000000000CC /* vphone-launchpad-cli in Embed Command Line Tool */ = {isa = PBXBuildFile; fileRef = 5A10000000000000000000C1 /* vphone-launchpad-cli */; };+ 5A10000000000000000000D2 /* vphone-guest-control in Embed Skill */ = {isa = PBXBuildFile; fileRef = 5A10000000000000000000D1 /* vphone-guest-control */; };/* End PBXBuildFile section *//* Begin PBXContainerItemProxy section */5A1000000000000000000071 /* PBXContainerItemProxy */ = {isa = PBXContainerItemProxy; containerPortal = 5A1000000000000000000001 /* Project object */; proxyType = 1; remoteGlobalIDString = 5A1000000000000000000012; remoteInfo = VPhoneLaunchpadHelper; };@@ -16,6 +17,7 @@/* Begin PBXCopyFilesBuildPhase section */5A1000000000000000000053 /* Embed Privileged Helper */ = {isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = Contents/Library/LaunchServices; dstSubfolderSpec = 1; files = (5A1000000000000000000061 /* com.vphone.launchpad.helper in Embed Privileged Helper */, ); name = "Embed Privileged Helper"; runOnlyForDeploymentPostprocessing = 0; };5A10000000000000000000CD /* Embed Command Line Tool */ = {isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 6; files = (5A10000000000000000000CC /* vphone-launchpad-cli in Embed Command Line Tool */, ); name = "Embed Command Line Tool"; runOnlyForDeploymentPostprocessing = 0; };+ 5A10000000000000000000D3 /* Embed Skill */ = {isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = Skills; dstSubfolderSpec = 7; files = (5A10000000000000000000D2 /* vphone-guest-control in Embed Skill */, ); name = "Embed Skill"; runOnlyForDeploymentPostprocessing = 0; };/* End PBXCopyFilesBuildPhase section *//* Begin PBXFileReference section */5A1000000000000000000031 /* vphone-launchpad.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "vphone-launchpad.app"; sourceTree = BUILT_PRODUCTS_DIR; };@@ -31,6 +33,7 @@5A100000000000000000003B /* VPhoneLaunchpadHelper.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = VPhoneLaunchpadHelper.xcconfig; sourceTree = "<group>"; };5A10000000000000000000C1 /* vphone-launchpad-cli */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "vphone-launchpad-cli"; sourceTree = BUILT_PRODUCTS_DIR; };5A10000000000000000000C2 /* VPhoneLaunchpadCLI.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = VPhoneLaunchpadCLI.xcconfig; sourceTree = "<group>"; };+ 5A10000000000000000000D1 /* vphone-guest-control */ = {isa = PBXFileReference; lastKnownFileType = folder; name = "vphone-guest-control"; path = "../Skills/vphone-guest-control"; sourceTree = SOURCE_ROOT; };/* End PBXFileReference section *//* Begin PBXFileSystemSynchronizedBuildFileExceptionSet section */5A10000000000000000000CE /* PBXFileSystemSynchronizedBuildFileExceptionSet */ = {isa = PBXFileSystemSynchronizedBuildFileExceptionSet; membershipExceptions = (VPhoneLaunchpadControl.swift, ); target = 5A1000000000000000000012 /* VPhoneLaunchpadHelper */; };@@ -50,13 +53,13 @@5A1000000000000000000002 = {isa = PBXGroup; children = (5A1000000000000000000021 /* VPhoneLaunchpad */, 5A1000000000000000000022 /* VPhoneLaunchpadHelper */, 5A10000000000000000000C3 /* VPhoneLaunchpadCLI */, 5A1000000000000000000023 /* VPhoneLaunchpadShared */, 5A1000000000000000000004 /* Configuration */, 5A1000000000000000000005 /* Resources */, 5A1000000000000000000003 /* Products */, ); sourceTree = "<group>"; };5A1000000000000000000003 /* Products */ = {isa = PBXGroup; children = (5A1000000000000000000031 /* vphone-launchpad.app */, 5A1000000000000000000032 /* com.vphone.launchpad.helper */, 5A10000000000000000000C1 /* vphone-launchpad-cli */, ); name = Products; sourceTree = "<group>"; };5A1000000000000000000004 /* Configuration */ = {isa = PBXGroup; children = (5A1000000000000000000037 /* Version.xcconfig */, 5A1000000000000000000033 /* Base.xcconfig */, 5A1000000000000000000038 /* Development.xcconfig */, 5A1000000000000000000039 /* Release.xcconfig */, 5A100000000000000000003A /* VPhoneLaunchpad.xcconfig */, 5A100000000000000000003B /* VPhoneLaunchpadHelper.xcconfig */, 5A10000000000000000000C2 /* VPhoneLaunchpadCLI.xcconfig */, ); path = Configuration; sourceTree = "<group>"; };- 5A1000000000000000000005 /* Resources */ = {isa = PBXGroup; children = (5A1000000000000000000034 /* VPhoneLaunchpad.Info.plist */, 5A1000000000000000000035 /* VPhoneLaunchpadHelper.Info.plist */, 5A1000000000000000000036 /* VPhoneLaunchpadHelper.Launchd.plist */, ); path = Resources; sourceTree = "<group>"; };+ 5A1000000000000000000005 /* Resources */ = {isa = PBXGroup; children = (5A1000000000000000000034 /* VPhoneLaunchpad.Info.plist */, 5A1000000000000000000035 /* VPhoneLaunchpadHelper.Info.plist */, 5A1000000000000000000036 /* VPhoneLaunchpadHelper.Launchd.plist */, 5A10000000000000000000D1 /* vphone-guest-control */, ); path = Resources; sourceTree = "<group>"; };/* End PBXGroup section *//* Begin PBXNativeTarget section */5A1000000000000000000011 /* VPhoneLaunchpad */ = {isa = PBXNativeTarget;buildConfigurationList = 5A1000000000000000000092 /* Build configuration list for PBXNativeTarget "VPhoneLaunchpad" */;- buildPhases = (5A1000000000000000000051 /* Sources */, 5A1000000000000000000041 /* Frameworks */, 5A1000000000000000000052 /* Resources */, 5A1000000000000000000053 /* Embed Privileged Helper */, 5A10000000000000000000CD /* Embed Command Line Tool */, );+ buildPhases = (5A1000000000000000000051 /* Sources */, 5A1000000000000000000041 /* Frameworks */, 5A1000000000000000000052 /* Resources */, 5A1000000000000000000053 /* Embed Privileged Helper */, 5A10000000000000000000CD /* Embed Command Line Tool */, 5A10000000000000000000D3 /* Embed Skill */, );buildRules = ();dependencies = (5A1000000000000000000072 /* PBXTargetDependency */, 5A10000000000000000000CB /* PBXTargetDependency */, );fileSystemSynchronizedGroups = (5A1000000000000000000021 /* VPhoneLaunchpad */, 5A1000000000000000000023 /* VPhoneLaunchpadShared */, );diff --git a/VPhoneLaunchpad/VPhoneLaunchpad/Application/VPhoneLaunchpadPreview.swift b/VPhoneLaunchpad/VPhoneLaunchpad/Application/VPhoneLaunchpadPreview.swiftindex a43484a6..97b00629 100644--- a/VPhoneLaunchpad/VPhoneLaunchpad/Application/VPhoneLaunchpadPreview.swift+++ b/VPhoneLaunchpad/VPhoneLaunchpad/Application/VPhoneLaunchpadPreview.swift@@ -65,6 +65,9 @@coreBundleSource = .releasesawait panel(model, .hostSetup, "04-host-setup-passed", suffix)+ await standalone("04b-skill-install", suffix, size: NSSize(width: 520, height: 460)) {+ VPhoneLaunchpadSkillInstallView()+ }model.machines.selection = [path("research-01")]await shot("05-machines", suffix)diff --git a/VPhoneLaunchpad/VPhoneLaunchpad/CoreBundle/VPhoneLaunchpadCoreBundleView.swift b/VPhoneLaunchpad/VPhoneLaunchpad/CoreBundle/VPhoneLaunchpadCoreBundleView.swiftindex 84626f5a..fdcd8a18 100644--- a/VPhoneLaunchpad/VPhoneLaunchpad/CoreBundle/VPhoneLaunchpadCoreBundleView.swift+++ b/VPhoneLaunchpad/VPhoneLaunchpad/CoreBundle/VPhoneLaunchpadCoreBundleView.swift@@ -25,13 +25,6 @@ struct VPhoneLaunchpadCoreBundleView: View {@Bindable var bundles = bundlesVPhoneLaunchpadSheet(Text("Core Bundle")) {Form {- if bundles.isInstalling {- Section {- LabeledContent("An install is in progress.") {- Button("Show Progress") { model.present(.bundleInstall) }- }- }- }if !bundles.installed.isEmpty {installedSection}diff --git a/VPhoneLaunchpad/VPhoneLaunchpad/HostSetup/VPhoneLaunchpadHostSetupView.swift b/VPhoneLaunchpad/VPhoneLaunchpad/HostSetup/VPhoneLaunchpadHostSetupView.swiftindex b2672692..00a348ab 100644--- a/VPhoneLaunchpad/VPhoneLaunchpad/HostSetup/VPhoneLaunchpadHostSetupView.swift+++ b/VPhoneLaunchpad/VPhoneLaunchpad/HostSetup/VPhoneLaunchpadHostSetupView.swift@@ -4,6 +4,7 @@ struct VPhoneLaunchpadHostSetupView: View {@Environment(VPhoneLaunchpadModel.self) private var model@Environment(\.dismiss) private var dismiss@AppStorage(VPhoneLaunchpadMenuBar.key) private var showsInMenuBar = false+ @State private var showsSkillInstall = falseprivate var host: VPhoneLaunchpadHostSetup {model.host@@ -19,6 +20,8 @@ struct VPhoneLaunchpadHostSetupView: View {}.help("Run every check again").disabled(host.isChecking)+ Button("Install Skill…") { showsSkillInstall = true }+ .help("Give your coding agent the vphone skill")} actions: {// Straight on to the next stage while it is not ready.if host.requiredPassed, !model.bundles.isReady {@@ -30,6 +33,9 @@ struct VPhoneLaunchpadHostSetupView: View {}}.frame(width: 600, height: 600)+ .sheet(isPresented: $showsSkillInstall) {+ VPhoneLaunchpadSkillInstallView()+ }.onReceive(NotificationCenter.default.publisher(for: NSApplication.didBecomeActiveNotification)) { _ inhost.refreshDeveloperTools()}diff --git a/VPhoneLaunchpad/VPhoneLaunchpad/HostSetup/VPhoneLaunchpadSkillInstallView.swift b/VPhoneLaunchpad/VPhoneLaunchpad/HostSetup/VPhoneLaunchpadSkillInstallView.swiftnew file mode 100644index 00000000..a5a57a5b--- /dev/null+++ b/VPhoneLaunchpad/VPhoneLaunchpad/HostSetup/VPhoneLaunchpadSkillInstallView.swift@@ -0,0 +1,80 @@+import AppKit+import SwiftUI++/// Hands the vphone skill to the user's own coding agent. Agents keep skills in+/// different places, so Launchpad installs nothing itself: it shows a prompt+/// that names the skill folder inside this app, and the agent copies it.+struct VPhoneLaunchpadSkillInstallView: View {+ @Environment(\.dismiss) private var dismiss+ @State private var copied = false++ /// The skill folder the build copies into Contents/Resources/Skills.+ static var skillURL: URL? {+ let url = Bundle.main.resourceURL?+ .appendingPathComponent("Skills", isDirectory: true)+ .appendingPathComponent("vphone-guest-control", isDirectory: true)+ guard let url, FileManager.default.fileExists(atPath: url.appendingPathComponent("SKILL.md").path) else {+ return nil+ }+ return url+ }++ private var prompt: String? {+ Self.skillURL.map { url in+ """+ Install the vphone skill so you can use it in later sessions.++ The skill is the folder:+ \(url.path)++ Read SKILL.md there, then copy the whole folder, with its references/ folder beside SKILL.md, into the place where you load skills from. Check that place for your own agent first, and ask me if you are not sure. Do not change anything inside the app bundle.+ """+ }+ }++ var body: some View {+ VPhoneLaunchpadSheet(Text("Install Skill")) {+ VStack(alignment: .leading, spacing: 12) {+ Text("Give this to your coding agent, such as Claude Code, Codex or Grok. It reads the vphone skill from this Mac and installs it where that agent expects skills.")+ .foregroundStyle(.secondary)+ .fixedSize(horizontal: false, vertical: true)++ if let prompt {+ ScrollView {+ Text(prompt)+ .font(.system(.callout, design: .monospaced))+ .textSelection(.enabled)+ .frame(maxWidth: .infinity, alignment: .leading)+ .padding(12)+ }+ .background(.quaternary.opacity(0.5), in: RoundedRectangle(cornerRadius: 8))+ } else {+ Text("This copy of Launchpad does not contain the skill.")+ .foregroundStyle(.secondary)+ Spacer(minLength: 0)+ }+ }+ .padding(16)+ } accessory: {+ Button("Show in Finder") {+ if let url = Self.skillURL {+ NSWorkspace.shared.activateFileViewerSelecting([url])+ }+ }+ .disabled(prompt == nil)+ } actions: {+ Button(copied ? "Copied" : "Copy Prompt") {+ guard let prompt else {+ return+ }+ NSPasteboard.general.clearContents()+ NSPasteboard.general.setString(prompt, forType: .string)+ copied = true+ }+ .disabled(prompt == nil)+ Button("Done") { dismiss() }+ .keyboardShortcut(.defaultAction)+ }+ .frame(width: 520, height: 460)+ }+}diff --git a/VPhoneLaunchpad/VPhoneLaunchpad/Localizable.xcstrings b/VPhoneLaunchpad/VPhoneLaunchpad/Localizable.xcstringsindex 1c620f80..49d170ca 100644--- a/VPhoneLaunchpad/VPhoneLaunchpad/Localizable.xcstrings+++ b/VPhoneLaunchpad/VPhoneLaunchpad/Localizable.xcstrings@@ -1479,40 +1479,6 @@}}},- "An install is in progress." : {- "localizations" : {- "en" : {- "stringUnit" : {- "state" : "translated",- "value" : "An install is in progress."- }- },- "ja" : {- "stringUnit" : {- "state" : "translated",- "value" : "インストール中です。"- }- },- "ko" : {- "stringUnit" : {- "state" : "translated",- "value" : "설치가 진행 중입니다."- }- },- "vi" : {- "stringUnit" : {- "state" : "translated",- "value" : "Đang cài đặt."- }- },- "zh-Hans" : {- "stringUnit" : {- "state" : "translated",- "value" : "正在安装。"- }- }- }- },"Apple silicon" : {"localizations" : {"en" : {@@ -1921,6 +1887,69 @@}}},+ "Install Skill" : {+ "localizations" : {+ "en" : { "stringUnit" : { "state" : "translated", "value" : "Install Skill" } },+ "ja" : { "stringUnit" : { "state" : "translated", "value" : "スキルをインストール" } },+ "ko" : { "stringUnit" : { "state" : "translated", "value" : "스킬 설치" } },+ "vi" : { "stringUnit" : { "state" : "translated", "value" : "Cài đặt skill" } },+ "zh-Hans" : { "stringUnit" : { "state" : "translated", "value" : "安装 Skill" } }+ }+ },+ "Install Skill…" : {+ "localizations" : {+ "en" : { "stringUnit" : { "state" : "translated", "value" : "Install Skill…" } },+ "ja" : { "stringUnit" : { "state" : "translated", "value" : "スキルをインストール…" } },+ "ko" : { "stringUnit" : { "state" : "translated", "value" : "스킬 설치…" } },+ "vi" : { "stringUnit" : { "state" : "translated", "value" : "Cài đặt skill…" } },+ "zh-Hans" : { "stringUnit" : { "state" : "translated", "value" : "安装 Skill…" } }+ }+ },+ "Give your coding agent the vphone skill" : {+ "localizations" : {+ "en" : { "stringUnit" : { "state" : "translated", "value" : "Give your coding agent the vphone skill" } },+ "ja" : { "stringUnit" : { "state" : "translated", "value" : "コーディングエージェントに vphone スキルを渡します" } },+ "ko" : { "stringUnit" : { "state" : "translated", "value" : "코딩 에이전트에 vphone 스킬을 전달합니다" } },+ "vi" : { "stringUnit" : { "state" : "translated", "value" : "Đưa skill vphone cho agent lập trình của bạn" } },+ "zh-Hans" : { "stringUnit" : { "state" : "translated", "value" : "把 vphone skill 交给你的编程 Agent" } }+ }+ },+ "Give this to your coding agent, such as Claude Code, Codex or Grok. It reads the vphone skill from this Mac and installs it where that agent expects skills." : {+ "localizations" : {+ "en" : { "stringUnit" : { "state" : "translated", "value" : "Give this to your coding agent, such as Claude Code, Codex or Grok. It reads the vphone skill from this Mac and installs it where that agent expects skills." } },+ "ja" : { "stringUnit" : { "state" : "translated", "value" : "Claude Code、Codex、Grok などのコーディングエージェントに渡してください。この Mac から vphone スキルを読み取り、そのエージェントがスキルを置く場所にインストールします。" } },+ "ko" : { "stringUnit" : { "state" : "translated", "value" : "Claude Code, Codex, Grok 같은 코딩 에이전트에 전달하세요. 이 Mac에서 vphone 스킬을 읽어 해당 에이전트가 스킬을 두는 위치에 설치합니다." } },+ "vi" : { "stringUnit" : { "state" : "translated", "value" : "Đưa nội dung này cho agent lập trình của bạn, như Claude Code, Codex hoặc Grok. Agent sẽ đọc skill vphone trên máy Mac này và cài vào nơi agent đó tải skill." } },+ "zh-Hans" : { "stringUnit" : { "state" : "translated", "value" : "把这段话交给你的编程 Agent,例如 Claude Code、Codex 或 Grok。它会读取这台 Mac 上的 vphone skill,并装到该 Agent 存放 skill 的位置。" } }+ }+ },+ "This copy of Launchpad does not contain the skill." : {+ "localizations" : {+ "en" : { "stringUnit" : { "state" : "translated", "value" : "This copy of Launchpad does not contain the skill." } },+ "ja" : { "stringUnit" : { "state" : "translated", "value" : "この Launchpad にはスキルが含まれていません。" } },+ "ko" : { "stringUnit" : { "state" : "translated", "value" : "이 Launchpad에는 스킬이 포함되어 있지 않습니다." } },+ "vi" : { "stringUnit" : { "state" : "translated", "value" : "Bản Launchpad này không chứa skill." } },+ "zh-Hans" : { "stringUnit" : { "state" : "translated", "value" : "这份 Launchpad 不包含 skill。" } }+ }+ },+ "Copy Prompt" : {+ "localizations" : {+ "en" : { "stringUnit" : { "state" : "translated", "value" : "Copy Prompt" } },+ "ja" : { "stringUnit" : { "state" : "translated", "value" : "プロンプトをコピー" } },+ "ko" : { "stringUnit" : { "state" : "translated", "value" : "프롬프트 복사" } },+ "vi" : { "stringUnit" : { "state" : "translated", "value" : "Sao chép prompt" } },+ "zh-Hans" : { "stringUnit" : { "state" : "translated", "value" : "复制提示词" } }+ }+ },+ "Copied" : {+ "localizations" : {+ "en" : { "stringUnit" : { "state" : "translated", "value" : "Copied" } },+ "ja" : { "stringUnit" : { "state" : "translated", "value" : "コピーしました" } },+ "ko" : { "stringUnit" : { "state" : "translated", "value" : "복사됨" } },+ "vi" : { "stringUnit" : { "state" : "translated", "value" : "Đã sao chép" } },+ "zh-Hans" : { "stringUnit" : { "state" : "translated", "value" : "已复制" } }+ }+ },"Check Again" : {"localizations" : {"en" : {