Let an AI model use a real iPhone with a $7 ESP32: AirPlay eyes, USB HID hands, any OpenAI-compatible vision model. No Mac, no developer account, no jailbreak.
ios: store release prep — TestFlight lane, crash reports, privacy manifest
Henry20e5d6aeb76f
diff --git a/docs/privacy.md b/docs/privacy.mdnew file mode 100644index 0000000..ab10e56--- /dev/null+++ b/docs/privacy.md@@ -0,0 +1,35 @@+# ESP32 Agent — Privacy Policy++Last updated: 2026-10-15++ESP32 Agent is an open-source app that lets an AI model of your choice operate your iPhone through a small+ESP32 USB board. The developer runs no servers for it and receives no data from it.++## What the app does with your data++- **Screen and run data.** To decide each step, the app sends screenshots of your iPhone screen and your task+ text to the model endpoint **you** set up (a cloud API or your own server). That provider's privacy policy+ applies to those requests. Nothing is sent anywhere else.+- **On your iPhone only.** Runs (steps, model replies, screenshots, screen video), the debug log and crash+ reports from iOS are stored in the app's own storage. You can delete runs in the app, or delete the app to+ remove everything.+- **API key.** Your model API key is stored in the iOS Keychain on this device and is never written to logs+ or exports.+- **Bluetooth and Wi-Fi.** The app connects to the ESP32 board over Bluetooth and may join the board's own+ Wi-Fi hotspot. It does not scan for or record other devices or networks.+- **Sharing.** Run archives and logs leave the phone only when you export or share them yourself, e.g. to+ attach to a bug report.++## What the app does not do++No accounts, no analytics, no advertising, no tracking, and no third-party SDKs. The app does not collect+data for the developer.++## Apple++If you install a TestFlight build or allow "Share with App Developers" in iOS settings, Apple may pass crash+reports and usage statistics to the developer under Apple's own privacy policy.++## Contact++Open an issue at https://github.com/onehumanbeing/esp32-iphone-agent/issues.diff --git a/ios/.gitignore b/ios/.gitignoreindex c8ce5d0..eb81f68 100644--- a/ios/.gitignore+++ b/ios/.gitignore@@ -4,3 +4,5 @@ DerivedData/*.xcodeproj/xcuserdata/*.xcodeproj/project.xcworkspace/xcuserdata/build-sim/+fastlane/report.xml+fastlane/README.mddiff --git a/ios/AgentActivity/Info.plist b/ios/AgentActivity/Info.plistindex 472b7fb..5a76d01 100644--- a/ios/AgentActivity/Info.plist+++ b/ios/AgentActivity/Info.plist@@ -22,9 +22,9 @@<key>CFBundlePackageType</key><string>XPC!</string><key>CFBundleShortVersionString</key>- <string>1.0</string>+ <string>$(MARKETING_VERSION)</string><key>CFBundleVersion</key>- <string>1</string>+ <string>$(CURRENT_PROJECT_VERSION)</string><key>IAAppGroup</key><string>group.$(IA_BUNDLE_ID)</string><key>NSExtension</key>diff --git a/ios/AgentActivity/PrivacyInfo.xcprivacy b/ios/AgentActivity/PrivacyInfo.xcprivacynew file mode 100644index 0000000..0fee526--- /dev/null+++ b/ios/AgentActivity/PrivacyInfo.xcprivacy@@ -0,0 +1,25 @@+<?xml version="1.0" encoding="UTF-8"?>+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">+<!-- No tracking and no data collected by the developer: model requests go to the endpoint the user sets up. -->+<plist version="1.0">+<dict>+ <key>NSPrivacyTracking</key>+ <false/>+ <key>NSPrivacyTrackingDomains</key>+ <array/>+ <key>NSPrivacyCollectedDataTypes</key>+ <array/>+ <key>NSPrivacyAccessedAPITypes</key>+ <array>+ <dict>+ <key>NSPrivacyAccessedAPIType</key>+ <string>NSPrivacyAccessedAPICategoryUserDefaults</string>+ <key>NSPrivacyAccessedAPITypeReasons</key>+ <array>+ <string>CA92.1</string>+ <string>1C8F.1</string>+ </array>+ </dict>+ </array>+</dict>+</plist>diff --git a/ios/Config/Shared.xcconfig b/ios/Config/Shared.xcconfigindex efba909..a21061f 100644--- a/ios/Config/Shared.xcconfig+++ b/ios/Config/Shared.xcconfig@@ -1,20 +1,25 @@// Signing: put your team in Config/Local.xcconfig (gitignored), e.g.// DEVELOPMENT_TEAM = ABCDE12345-// Set // Bundle ID of the app; the widget extension and tests append a suffix, the App Group is group.<this>.+// Bundle ID of the app; the widget extension and tests append a suffix, the App Group is group.<this>.// Set your own in Local.xcconfig.IA_BUNDLE_ID = com.example.esp32agent-IA_ENTITLEMENTS = IPhoneAgent/IPhoneAgent.entitlements in Local.xcconfig-// once Xcode is signed in, to enable one-tap joining of the board's hotspot.+// Once Xcode is signed in, set IA_ENTITLEMENTS = IPhoneAgent/IPhoneAgent.entitlements in Local.xcconfig+// to enable one-tap joining of the board's hotspot, and IA_WIDGET_ENTITLEMENTS =+// AgentActivity/AgentActivity.entitlements so the widgets share the App Group.IA_ENTITLEMENTS =-// Also set IA_WIDGET_ENTITLEMENTS = AgentActivity/AgentActivity.entitlements so the widgets share the App Group.IA_WIDGET_ENTITLEMENTS =-// Optional LLM preset for your own builds, set in Local.xcconfig (write "//" as "/$()/"):+// Optional LLM preset for your own builds, set in Local.xcconfig (write "//" as "/$()/").+// Never in a store build: fastlane's beta lane clears these and checks the built app.// IA_PRESET_BASE_URL = https:/$()/example.com/v1IA_PRESET_BASE_URL =IA_PRESET_MODEL =IA_PRESET_KEY =+// The app and its widget extension share these; fastlane sets the build number for each upload.+MARKETING_VERSION = 1.0+CURRENT_PROJECT_VERSION = 1+#include? "Local.xcconfig"diff --git a/ios/IPhoneAgent.xcodeproj/project.pbxproj b/ios/IPhoneAgent.xcodeproj/project.pbxprojindex 779aa7c..c2fa751 100644--- a/ios/IPhoneAgent.xcodeproj/project.pbxproj+++ b/ios/IPhoneAgent.xcodeproj/project.pbxproj@@ -38,6 +38,7 @@4C33F19F733F62B5A131BE9E /* TouchCalibration.swift in Sources */ = {isa = PBXBuildFile; fileRef = C70A2F48B5948F180DF1450C /* TouchCalibration.swift */; };4C9AF1D3470474D2AB745D00 /* SettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E74E2758C4170812147466F /* SettingsView.swift */; };4CA70811574C401EB0012355 /* Notifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 05DA6345A40715C8BD2AED6C /* Notifier.swift */; };+ 534DEFD19932A64B5E0363D4 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = E7318AED24A07B92CBB7496E /* PrivacyInfo.xcprivacy */; };5529FEF43DA98563B4BCFEC1 /* AgentFace.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7314ABD64EC1106422C685E /* AgentFace.swift */; };57716E1B9BBB6026600DAD4C /* AgentSnapshot.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EC8ECB7FF0B63991E8AEFFB /* AgentSnapshot.swift */; };58405C052C5CE287759E2AA4 /* ProbeFit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 435B39A7D499300AADA2D16C /* ProbeFit.swift */; };@@ -84,6 +85,7 @@A5A78F1B4D15D843B8932932 /* ModelProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8A02583BE955659071F3172 /* ModelProvider.swift */; };ABEF22E60573E04FACD0E4A9 /* AgentFace.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7314ABD64EC1106422C685E /* AgentFace.swift */; };AD702230192ADBF827044490 /* LiveActivity.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27A03E1A122C50B8ED88AC91 /* LiveActivity.swift */; };+ AE1B524EBE9E22B698176242 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 9924DF8869348C0458073E8B /* PrivacyInfo.xcprivacy */; };B356EECAFE045249704E63FD /* MockMode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 13664BFD54E7827E0E53B7F6 /* MockMode.swift */; };B86BD0431A675EC2681E03A7 /* AgentActivityWidget.swift in Sources */ = {isa = PBXBuildFile; fileRef = 86452ED01E883A6E57BB13E4 /* AgentActivityWidget.swift */; };B9B15030A9EEC21B4512533B /* HotspotJoin.swift in Sources */ = {isa = PBXBuildFile; fileRef = C12C6B350F7AFD555CE0B8EA /* HotspotJoin.swift */; };@@ -103,6 +105,7 @@E8FA336F818FBAB651C32BEE /* AgentActivity.swift in Sources */ = {isa = PBXBuildFile; fileRef = B155ADD97189D634A809EDE9 /* AgentActivity.swift */; };EF83C4DFA24497FDB0BF123E /* mock-frame.jpg in Resources */ = {isa = PBXBuildFile; fileRef = F0918D2C621FD17EDD51AF5E /* mock-frame.jpg */; };F0989DBA8FA72168CA371221 /* IslandStatus.swift in Sources */ = {isa = PBXBuildFile; fileRef = CFB37456C763ADFEF9E577A2 /* IslandStatus.swift */; };+ F0A801D7B4454233734A9494 /* CrashReports.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0FB6A431F87BEDCFBF1201C4 /* CrashReports.swift */; };F2D091FC47717266EFF75FBA /* ReviewView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31BF05E92BF9DC3156F81ED6 /* ReviewView.swift */; };F2FFDB2986493F65EB6A9738 /* LogUploader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4D9FABC284798F9949C1A8EF /* LogUploader.swift */; };F3DE9777E0FAD414E17465BC /* VideoAssembler.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD4270DF66937405FC86B145 /* VideoAssembler.swift */; };@@ -149,6 +152,7 @@0884D2AF849046D0FA2E62C1 /* StoreTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StoreTests.swift; sourceTree = "<group>"; };0B88A1538529C9674B323370 /* DebugLog.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DebugLog.swift; sourceTree = "<group>"; };0DFECC30B2ADEB1BB69072EC /* BoardProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BoardProtocol.swift; sourceTree = "<group>"; };+ 0FB6A431F87BEDCFBF1201C4 /* CrashReports.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CrashReports.swift; sourceTree = "<group>"; };13664BFD54E7827E0E53B7F6 /* MockMode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockMode.swift; sourceTree = "<group>"; };16165E2AD13D29F06CBFA5B0 /* AgentActivity.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = AgentActivity.entitlements; sourceTree = "<group>"; };17DBD3270E7E91B39C3C7438 /* AgentLoop.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AgentLoop.swift; sourceTree = "<group>"; };@@ -207,6 +211,7 @@96BDA430E0C54DC956DE9366 /* StatusChips.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatusChips.swift; sourceTree = "<group>"; };98111895572CDFBCBA4C5268 /* Shared.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Shared.xcconfig; sourceTree = "<group>"; };98425438C4A7C1EB827CDD2C /* IPhoneAgent.app */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.application; path = IPhoneAgent.app; sourceTree = BUILT_PRODUCTS_DIR; };+ 9924DF8869348C0458073E8B /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; path = PrivacyInfo.xcprivacy; sourceTree = "<group>"; };99381FBF82EA7EB76556866E /* OnboardingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingView.swift; sourceTree = "<group>"; };A11E0FF01881451EBB3D18FF /* AgentActivity.appex */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = "wrapper.app-extension"; path = AgentActivity.appex; sourceTree = BUILT_PRODUCTS_DIR; };A409B3696F547E712B4D4D14 /* PokeableFace.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PokeableFace.swift; sourceTree = "<group>"; };@@ -239,6 +244,7 @@E1FF376927D9503ABF677854 /* Vision.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Vision.swift; sourceTree = "<group>"; };E2E3712143A195602610004B /* CalibrationToast.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CalibrationToast.swift; sourceTree = "<group>"; };E37B39FEB9A7A965ED4A86B3 /* Localizable.xcstrings */ = {isa = PBXFileReference; lastKnownFileType = text.json.xcstrings; path = Localizable.xcstrings; sourceTree = "<group>"; };+ E7318AED24A07B92CBB7496E /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; path = PrivacyInfo.xcprivacy; sourceTree = "<group>"; };E7721FA5F1DD53610AD0B737 /* InfoPlist.xcstrings */ = {isa = PBXFileReference; lastKnownFileType = text.json.xcstrings; path = InfoPlist.xcstrings; sourceTree = "<group>"; };E948F0EBC262C7ABF8E413E5 /* AboutView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AboutView.swift; sourceTree = "<group>"; };EDB8774D34E5E3FEF5C7A1E6 /* Settings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Settings.swift; sourceTree = "<group>"; };@@ -366,6 +372,7 @@E7721FA5F1DD53610AD0B737 /* InfoPlist.xcstrings */,DA2DCFC32B990B166DF9C1C6 /* IPhoneAgent.entitlements */,1C25AC81D9FBF6073FDD1851 /* Localizable.xcstrings */,+ E7318AED24A07B92CBB7496E /* PrivacyInfo.xcprivacy */,0753133D3A6ABA1AE76560A5 /* Agent */,7CA15ABF933E415D7A5C913F /* App */,8DC40723EB5CCA5BC6501702 /* Board */,@@ -386,6 +393,7 @@3A091027B026D22579AA4972 /* HomeWidgets.swift */,45B51ED9B63507FA8E2D2A52 /* Info.plist */,E37B39FEB9A7A965ED4A86B3 /* Localizable.xcstrings */,+ 9924DF8869348C0458073E8B /* PrivacyInfo.xcprivacy */,);path = AgentActivity;sourceTree = "<group>";@@ -415,6 +423,7 @@84CF32A0010E6F1E5085D90E /* Services */ = {isa = PBXGroup;children = (+ 0FB6A431F87BEDCFBF1201C4 /* CrashReports.swift */,0B88A1538529C9674B323370 /* DebugLog.swift */,DCDA925D0FFD42810895573C /* LLMClient.swift */,4D9FABC284798F9949C1A8EF /* LogUploader.swift */,@@ -584,6 +593,7 @@180133912100FC228377AE9A /* Assets.xcassets in Resources */,85678CC068CF3297ECF345DF /* InfoPlist.xcstrings in Resources */,63CB6644E6517C6B12F3E0AB /* Localizable.xcstrings in Resources */,+ 534DEFD19932A64B5E0363D4 /* PrivacyInfo.xcprivacy in Resources */,EF83C4DFA24497FDB0BF123E /* mock-frame.jpg in Resources */,D04078EE246F6B5EB38D64B5 /* prompts in Resources */,);@@ -594,6 +604,7 @@buildActionMask = 2147483647;files = (84CA12989B5CB62129C3419B /* Localizable.xcstrings in Resources */,+ AE1B524EBE9E22B698176242 /* PrivacyInfo.xcprivacy in Resources */,);runOnlyForDeploymentPostprocessing = 0;};@@ -653,6 +664,7 @@3298C81AB2EC4CBBC912ACFC /* BoardProximityIllustration.swift in Sources */,173BD54931BD69B83D7F6FD3 /* CalibrationToast.swift in Sources */,8A11B8068D97194AA3C9723B /* CalibrationViews.swift in Sources */,+ F0A801D7B4454233734A9494 /* CrashReports.swift in Sources */,006434261FDDF11EA3BF16E6 /* DebugEntry.swift in Sources */,419FA08397BAF31F91A62633 /* DebugLog.swift in Sources */,5D657D39BD5F6808ED60EDEA /* DemoRecorder.swift in Sources */,diff --git a/ios/IPhoneAgent/App/AppPresence.swift b/ios/IPhoneAgent/App/AppPresence.swiftindex b61bdc0..cf64d2f 100644--- a/ios/IPhoneAgent/App/AppPresence.swift+++ b/ios/IPhoneAgent/App/AppPresence.swift@@ -7,14 +7,13 @@ extension AppModel {private var inBackground: Bool { UIApplication.shared.applicationState == .background }- /// Leaves our own app without touching the screen: iOS's own suspend (as the Home gesture does),- /// then the board's Cmd+H and home flick as fallbacks. The model is never asked to do this.+ /// Leaves our own app without touching the screen: the board's Cmd+H, then its home flick as a fallback.+ /// The model is never asked to do this.func leaveApp() async -> Bool {- for method in ["suspend", "cmd+h", "home swipe"] {+ for method in ["cmd+h", "home swipe"] {if inBackground { return true }do {switch method {- case "suspend": await MainActor.run { _ = UIApplication.shared.perform(NSSelectorFromString("suspend")) }case "cmd+h": try await pointer.key("cmd+h")default: try await pointer.goHome()}diff --git a/ios/IPhoneAgent/App/DebugEntry.swift b/ios/IPhoneAgent/App/DebugEntry.swiftindex 236d75b..374ff60 100644--- a/ios/IPhoneAgent/App/DebugEntry.swift+++ b/ios/IPhoneAgent/App/DebugEntry.swift@@ -6,10 +6,14 @@ import Foundation/// or launch arguments: -run "<task>", -calibrate, -bench 256, -snap/// (e.g. `xcrun devicectl device process launch --device <id> <bundle id> -run "Open Clock"`)./// Commands that need the board wait up to 30 s for it (and mirroring, for a run) before giving up.+/// The URL commands exist in Debug builds only: in a release any web page could open them.extension AppModel {/// True when the URL was a debug command (iphoneagent://run/<id> from the Live Activity is not).@discardableResultfunc handleDebug(_ url: URL) -> Bool {+ #if !DEBUG+ return false+ #endifguard url.scheme == "iphoneagent", let host = url.host else { return false }let query = URLComponents(url: url, resolvingAgainstBaseURL: false)?.queryItems ?? []func arg(_ name: String) -> String? { query.first { $0.name == name }?.value }diff --git a/ios/IPhoneAgent/App/IPhoneAgentApp.swift b/ios/IPhoneAgent/App/IPhoneAgentApp.swiftindex 9944359..496dfcc 100644--- a/ios/IPhoneAgent/App/IPhoneAgentApp.swift+++ b/ios/IPhoneAgent/App/IPhoneAgentApp.swift@@ -4,7 +4,10 @@ import SwiftUIstruct IPhoneAgentApp: App {@StateObject private var app = AppModel.shared- init() { _ = AppModel.shared } // also on a background launch for an App Intent, which shows no scene+ init() {+ _ = AppModel.shared // also on a background launch for an App Intent, which shows no scene+ CrashReports.shared.start()+ }var body: some Scene {WindowGroup {diff --git a/ios/IPhoneAgent/Info.plist b/ios/IPhoneAgent/Info.plistindex 4461e0b..678ca8d 100644--- a/ios/IPhoneAgent/Info.plist+++ b/ios/IPhoneAgent/Info.plist@@ -35,7 +35,7 @@<key>CFBundlePackageType</key><string>APPL</string><key>CFBundleShortVersionString</key>- <string>1.0</string>+ <string>$(MARKETING_VERSION)</string><key>CFBundleURLTypes</key><array><dict>@@ -48,7 +48,7 @@</dict></array><key>CFBundleVersion</key>- <string>1</string>+ <string>$(CURRENT_PROJECT_VERSION)</string><key>IAAppGroup</key><string>group.$(IA_BUNDLE_ID)</string><key>IAPresetBaseURL</key>@@ -57,6 +57,8 @@<string>$(IA_PRESET_KEY)</string><key>IAPresetModel</key><string>$(IA_PRESET_MODEL)</string>+ <key>ITSAppUsesNonExemptEncryption</key>+ <false/><key>LSSupportsOpeningDocumentsInPlace</key><true/><key>NSBluetoothAlwaysUsageDescription</key>diff --git a/ios/IPhoneAgent/Localizable.xcstrings b/ios/IPhoneAgent/Localizable.xcstringsindex 920fca7..5695818 100644--- a/ios/IPhoneAgent/Localizable.xcstrings+++ b/ios/IPhoneAgent/Localizable.xcstrings@@ -1,66 +1,66 @@{"sourceLanguage" : "en","strings" : {- "The run is still active. Return to the Home Screen to continue.": {- "localizations": {- "zh-Hans": {- "stringUnit": {- "state": "translated",- "value": "任务仍在进行中。请返回手机主屏幕以继续。"+ "The run is still active. Return to the Home Screen to continue." : {+ "localizations" : {+ "zh-Hans" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "任务仍在进行中。请返回手机主屏幕以继续。"+ }}}- }- },- "Paused": {- "localizations": {- "zh-Hans": {- "stringUnit": {- "state": "translated",- "value": "已暂停"+ },+ "Paused" : {+ "localizations" : {+ "zh-Hans" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "已暂停"+ }}}- }- },- "The board connection was lost. Move the board closer and keep it powered on, then tap Retry.": {- "localizations": {- "zh-Hans": {- "stringUnit": {- "state": "translated",- "value": "与板子的连接已断开。请把板子移近并保持供电,然后点击重试。"+ },+ "The board connection was lost. Move the board closer and keep it powered on, then tap Retry." : {+ "localizations" : {+ "zh-Hans" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "与板子的连接已断开。请把板子移近并保持供电,然后点击重试。"+ }}}- }- },- "The run ended before it could finish. Retry to start again.": {- "localizations": {- "zh-Hans": {- "stringUnit": {- "state": "translated",- "value": "任务未完成便已结束。点击重试重新开始。"+ },+ "The run ended before it could finish. Retry to start again." : {+ "localizations" : {+ "zh-Hans" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "任务未完成便已结束。点击重试重新开始。"+ }}}- }- },- "Error details": {- "localizations": {- "zh-Hans": {- "stringUnit": {- "state": "translated",- "value": "错误详情"+ },+ "Error details" : {+ "localizations" : {+ "zh-Hans" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "错误详情"+ }}}- }- },- "Could not finish": {- "localizations": {- "zh-Hans": {- "stringUnit": {- "state": "translated",- "value": "未能完成"+ },+ "Could not finish" : {+ "localizations" : {+ "zh-Hans" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "未能完成"+ }}}- }- },+ },"" : {"shouldTranslate" : false},@@ -140,16 +140,6 @@}}},- "A zip of debug.log and every run (steps, model replies, screenshots, video). Your API key is never in it." : {- "localizations" : {- "zh-Hans" : {- "stringUnit" : {- "state" : "translated",- "value" : "包含 debug.log 和每次运行(步骤、模型回复、截图、视频)的压缩包。不会包含你的 API 密钥。"- }- }- }- },"API key" : {"localizations" : {"zh-Hans" : {@@ -5587,7 +5577,37 @@}}}+ },+ "Report a bug" : {+ "localizations" : {+ "zh-Hans" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "报告问题"+ }+ }+ }+ },+ "Opens a GitHub issue with your version filled in. Attach the zip from Logs › Export all logs: it holds the debug log, the runs and any crash reports iOS gave the app." : {+ "localizations" : {+ "zh-Hans" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "打开一个已填好版本信息的 GitHub issue。请附上「日志 › 导出全部日志」生成的压缩包:里面有调试日志、运行记录,以及 iOS 交给本 App 的崩溃报告。"+ }+ }+ }+ },+ "A zip of debug.log, crash reports from iOS and every run (steps, model replies, screenshots, video). Your API key is never in it." : {+ "localizations" : {+ "zh-Hans" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "包含 debug.log、iOS 崩溃报告和每次运行(步骤、模型回复、截图、视频)的压缩包。不会包含你的 API 密钥。"+ }+ }+ }}},"version" : "1.0"-}+}\ No newline at end of filediff --git a/ios/IPhoneAgent/PrivacyInfo.xcprivacy b/ios/IPhoneAgent/PrivacyInfo.xcprivacynew file mode 100644index 0000000..b8c9505--- /dev/null+++ b/ios/IPhoneAgent/PrivacyInfo.xcprivacy@@ -0,0 +1,33 @@+<?xml version="1.0" encoding="UTF-8"?>+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">+<!-- No tracking and no data collected by the developer: model requests go to the endpoint the user sets up. -->+<plist version="1.0">+<dict>+ <key>NSPrivacyTracking</key>+ <false/>+ <key>NSPrivacyTrackingDomains</key>+ <array/>+ <key>NSPrivacyCollectedDataTypes</key>+ <array/>+ <key>NSPrivacyAccessedAPITypes</key>+ <array>+ <dict>+ <key>NSPrivacyAccessedAPIType</key>+ <string>NSPrivacyAccessedAPICategoryUserDefaults</string>+ <key>NSPrivacyAccessedAPITypeReasons</key>+ <array>+ <string>CA92.1</string>+ <string>1C8F.1</string>+ </array>+ </dict>+ <dict>+ <key>NSPrivacyAccessedAPIType</key>+ <string>NSPrivacyAccessedAPICategoryFileTimestamp</string>+ <key>NSPrivacyAccessedAPITypeReasons</key>+ <array>+ <string>C617.1</string>+ </array>+ </dict>+ </array>+</dict>+</plist>diff --git a/ios/IPhoneAgent/Services/CrashReports.swift b/ios/IPhoneAgent/Services/CrashReports.swiftnew file mode 100644index 0000000..acba130--- /dev/null+++ b/ios/IPhoneAgent/Services/CrashReports.swift@@ -0,0 +1,32 @@+import Foundation+import MetricKit++/// Crash, hang and CPU/disk diagnostics from iOS (MetricKit), kept on the phone in Documents/diagnostics/.+/// iOS hands them over at the next launch (up to a day later). They ride along in Logs › Export all logs and+/// in Report a bug; nothing is sent anywhere by the app. TestFlight builds also send crashes to App Store Connect.+final class CrashReports: NSObject, MXMetricManagerSubscriber {+ static let shared = CrashReports()+ static let dir = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0]+ .appendingPathComponent("diagnostics", isDirectory: true)++ func start() { MXMetricManager.shared.add(self) }++ /// Reports kept so far, newest first.+ static var files: [URL] {+ let all = (try? FileManager.default.contentsOfDirectory(at: dir, includingPropertiesForKeys: nil)) ?? []+ return all.sorted { $0.lastPathComponent > $1.lastPathComponent }+ }++ func didReceive(_ payloads: [MXDiagnosticPayload]) {+ try? FileManager.default.createDirectory(at: Self.dir, withIntermediateDirectories: true)+ for p in payloads {+ let counts: [(String, Int)] = [("crash", p.crashDiagnostics?.count ?? 0), ("hang", p.hangDiagnostics?.count ?? 0),+ ("cpu", p.cpuExceptionDiagnostics?.count ?? 0),+ ("disk", p.diskWriteExceptionDiagnostics?.count ?? 0)]+ let kinds = counts.filter { $0.1 > 0 }.map { "\($0.1) \($0.0)" }+ let name = "\(Int(p.timeStampEnd.timeIntervalSince1970))-\(UUID().uuidString.prefix(6)).json"+ try? p.jsonRepresentation().write(to: Self.dir.appendingPathComponent(name))+ DebugLog.write("diagnostics: \(kinds.isEmpty ? "report" : kinds.joined(separator: ", ")) from iOS, saved \(name)")+ }+ }+}diff --git a/ios/IPhoneAgent/UI/AboutView.swift b/ios/IPhoneAgent/UI/AboutView.swiftindex 8f22a0d..8e39481 100644--- a/ios/IPhoneAgent/UI/AboutView.swift+++ b/ios/IPhoneAgent/UI/AboutView.swift@@ -12,6 +12,34 @@ struct AboutView: View {return "\(info?["CFBundleShortVersionString"] as? String ?? "1.0") (\(info?["CFBundleVersion"] as? String ?? "1"))"}+ /// A new GitHub issue, prefilled with what we always ask for.+ private var bugReport: URL {+ let device = UIDevice.current+ let body = """+ **What happened**+++ **What you expected**+++ **Steps**+ 1.++ ESP32 Agent \(version) · \(device.systemName) \(device.systemVersion) · \(Self.model)+ (Attach the zip from Settings › About › Logs › Export all logs.)+ """+ var c = URLComponents(url: Self.repo.appendingPathComponent("issues/new"), resolvingAgainstBaseURL: false)!+ c.queryItems = [URLQueryItem(name: "labels", value: "bug"), URLQueryItem(name: "body", value: body)]+ return c.url ?? Self.repo+ }++ /// The hardware model, e.g. "iPhone17,2".+ private static let model: String = {+ var info = utsname()+ uname(&info)+ return withUnsafeBytes(of: &info.machine) { String(decoding: $0.prefix { $0 != 0 }, as: UTF8.self) }+ }()+var body: some View {List {Section {@@ -41,9 +69,19 @@ struct AboutView: View {Text("Open source. No data leaves this iPhone except the requests to the model endpoint you set up.")}Section {+ Link(destination: bugReport) {+ HStack {+ SettingsLabel(title: "Report a bug", symbol: "ladybug.fill", color: .red)+ Spacer()+ Image(systemName: "arrow.up.forward.app").foregroundStyle(.tertiary)+ }+ }+ .tint(.primary)NavigationLink { LogsView(app: app) } label: {SettingsLabel(title: "Logs", symbol: "text.alignleft", color: .gray)}+ } footer: {+ Text("Opens a GitHub issue with your version filled in. Attach the zip from Logs › Export all logs: it holds the debug log, the runs and any crash reports iOS gave the app.")}}.navigationTitle("About")@@ -142,7 +180,7 @@ struct LogsView: View {ShareLink(item: DebugLog.url) { Label("Share debug log", systemImage: "doc.text.magnifyingglass") }}} footer: {- Text("A zip of debug.log and every run (steps, model replies, screenshots, video). Your API key is never in it.")+ Text("A zip of debug.log, crash reports from iOS and every run (steps, model replies, screenshots, video). Your API key is never in it.")}if app.log.isEmpty {Text("Nothing logged yet.").foregroundStyle(.secondary)@@ -171,7 +209,7 @@ struct LogsView: View {let docs = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0]DebugLog.write("export: all logs")Task {- let result = await Task.detached { Result { try TraceStore.zip(docs, name: "iphone-agent-logs.zip") } }.value+ let result = await Task.detached { Result { try TraceStore.zip(docs, name: "esp32-agent-logs.zip") } }.valueexporting = falseswitch result {case .success(let url): shareURL = urldiff --git a/ios/fastlane/Appfile b/ios/fastlane/Appfilenew file mode 100644index 0000000..47bd302--- /dev/null+++ b/ios/fastlane/Appfile@@ -0,0 +1 @@+app_identifier(ENV["IA_STORE_BUNDLE_ID"] || "com.onehumanbeing.esp32agent")diff --git a/ios/fastlane/Fastfile b/ios/fastlane/Fastfilenew file mode 100644index 0000000..1feb093--- /dev/null+++ b/ios/fastlane/Fastfile@@ -0,0 +1,65 @@+# Store builds: `fastlane beta` (from ios/) archives a Release and uploads it to TestFlight.+# Auth is an App Store Connect API key described in ~/.appstoreconnect/config.env+# (ASC_KEY_ID, ASC_ISSUER_ID, ASC_KEY_PATH); signing uses Xcode's Apple ID and the team in Config/Local.xcconfig.+# The LLM preset from Local.xcconfig is cleared and the built app is checked for it.++default_platform(:ios)++STORE_ENV = File.expand_path("~/.appstoreconnect/config.env")++def key_path+ File.expand_path(ENV["ASC_KEY_PATH"].gsub("$HOME", Dir.home))+end++platform :ios do+ private_lane :asc_key do+ File.readlines(STORE_ENV).each do |line|+ k, v = line.strip.split("=", 2)+ ENV[k] = v.delete('"') if k && v && !k.start_with?("#")+ end+ app_store_connect_api_key(key_id: ENV["ASC_KEY_ID"], issuer_id: ENV["ASC_ISSUER_ID"],+ key_filepath: key_path)+ end++ desc "Release build to TestFlight (internal testers get it once processing finishes)"+ lane :beta do+ asc_key+ bundle_id = CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier)+ build = latest_testflight_build_number(app_identifier: bundle_id, initial_build_number: 0) + 1+ # Signing uses the Apple ID signed in to Xcode: only it can register the App Group (the API key can't).+ auth = "-allowProvisioningUpdates"+ settings = {+ IA_BUNDLE_ID: bundle_id,+ IA_ENTITLEMENTS: "IPhoneAgent/IPhoneAgent.entitlements",+ IA_WIDGET_ENTITLEMENTS: "AgentActivity/AgentActivity.entitlements",+ IA_PRESET_BASE_URL: "", IA_PRESET_MODEL: "", IA_PRESET_KEY: "",+ CURRENT_PROJECT_VERSION: build,+ }.map { |k, v| "#{k}='#{v}'" }.join(" ")++ ipa = build_app(project: "IPhoneAgent.xcodeproj", scheme: "IPhoneAgent", configuration: "Release",+ export_method: "app-store", output_directory: "build/store", clean: true,+ xcargs: "#{settings} #{auth}", export_xcargs: auth)+ check_no_preset(ipa: ipa)+ upload_to_testflight(ipa: ipa, skip_waiting_for_build_processing: true)+ UI.success("Uploaded #{bundle_id} build #{build}")+ end++ # Stop the upload if any LLM preset made it into the app: the Info.plist keys must be empty, and the+ # key from Local.xcconfig must appear in no file of the app (it is never printed).+ private_lane :check_no_preset do |options|+ local = File.expand_path("../Config/Local.xcconfig", __dir__)+ key = File.exist?(local) ? File.read(local)[/^\s*IA_PRESET_KEY\s*=\s*(\S+)/, 1] : nil+ Dir.mktmpdir do |dir|+ sh("unzip", "-q", options[:ipa], "-d", dir, log: false)+ plist = Dir["#{dir}/Payload/*.app/Info.plist"].first+ %w[IAPresetKey IAPresetBaseURL IAPresetModel].each do |name|+ value = `/usr/libexec/PlistBuddy -c "Print :#{name}" "#{plist}" 2>/dev/null`.strip+ UI.user_error!("#{name} is set in the store build; refusing to upload") unless value.empty?+ end+ if key && system("grep", "-rqF", "--", key, dir)+ UI.user_error!("The preset API key is inside the store build; refusing to upload")+ end+ end+ UI.success("No LLM preset in the store build")+ end+enddiff --git a/ios/fastlane/metadata/en-US/description.txt b/ios/fastlane/metadata/en-US/description.txtnew file mode 100644index 0000000..b08e3f9--- /dev/null+++ b/ios/fastlane/metadata/en-US/description.txt@@ -0,0 +1,19 @@+ESP32 Agent lets an AI model use your iPhone the way you do: it looks at the screen, taps, swipes and types until the task is done.++It works through a small ESP32 USB board. Plug the board into your iPhone and the app connects to it over Bluetooth. Mirror the screen to the board once, and the model can see. The board then moves the pointer and types like a mouse and keyboard. No jailbreak, no Mac, no laptop.++HOW IT WORKS+• Plug it in. The board connects to the app over Bluetooth.+• Mirror once. Screen Mirroring to the board gives the model its eyes.+• Just tell it what to do. Type a task, and the agent works it out step by step.+• Every step is recorded. Replay a run, fix a step, and save it as your own intent.++YOUR MODEL, YOUR DATA+Use any OpenAI-compatible vision model: a cloud API or your own server at home. Screenshots go only to the endpoint you set up. Runs, logs and crash reports stay on your iPhone until you share them.++OPEN SOURCE+The app and the board firmware are open source: github.com/onehumanbeing/esp32-iphone-agent++REQUIREMENTS+• An ESP32-S3 board running the ESP32 Agent firmware (see the GitHub page)+• An endpoint for an OpenAI-compatible vision modeldiff --git a/ios/fastlane/metadata/en-US/keywords.txt b/ios/fastlane/metadata/en-US/keywords.txtnew file mode 100644index 0000000..daa610a--- /dev/null+++ b/ios/fastlane/metadata/en-US/keywords.txt@@ -0,0 +1 @@+ai,agent,automation,esp32,assistant,llm,vision,shortcuts,accessibility,open sourcediff --git a/ios/fastlane/metadata/en-US/name.txt b/ios/fastlane/metadata/en-US/name.txtnew file mode 100644index 0000000..5d41ec8--- /dev/null+++ b/ios/fastlane/metadata/en-US/name.txt@@ -0,0 +1 @@+ESP32 Agentdiff --git a/ios/fastlane/metadata/en-US/privacy_url.txt b/ios/fastlane/metadata/en-US/privacy_url.txtnew file mode 100644index 0000000..958e087--- /dev/null+++ b/ios/fastlane/metadata/en-US/privacy_url.txt@@ -0,0 +1 @@+https://github.com/onehumanbeing/esp32-iphone-agent/blob/main/docs/privacy.mddiff --git a/ios/fastlane/metadata/en-US/promotional_text.txt b/ios/fastlane/metadata/en-US/promotional_text.txtnew file mode 100644index 0000000..1784c7d--- /dev/null+++ b/ios/fastlane/metadata/en-US/promotional_text.txt@@ -0,0 +1 @@+Tell your iPhone what to do. An AI model of your choice sees the screen and works the apps for you.diff --git a/ios/fastlane/metadata/en-US/subtitle.txt b/ios/fastlane/metadata/en-US/subtitle.txtnew file mode 100644index 0000000..3a03a7a--- /dev/null+++ b/ios/fastlane/metadata/en-US/subtitle.txt@@ -0,0 +1 @@+AI agent for your phonediff --git a/ios/fastlane/metadata/en-US/support_url.txt b/ios/fastlane/metadata/en-US/support_url.txtnew file mode 100644index 0000000..d124005--- /dev/null+++ b/ios/fastlane/metadata/en-US/support_url.txt@@ -0,0 +1 @@+https://github.com/onehumanbeing/esp32-iphone-agentdiff --git a/ios/fastlane/metadata/review_information/notes.txt b/ios/fastlane/metadata/review_information/notes.txtnew file mode 100644index 0000000..d661b9d--- /dev/null+++ b/ios/fastlane/metadata/review_information/notes.txt@@ -0,0 +1,7 @@+ESP32 Agent needs a small ESP32-S3 USB board (open-source firmware) plugged into the iPhone. The board receives Screen Mirroring (the model's view of the screen) and acts as a standard USB HID mouse/keyboard; the app talks to it over Bluetooth LE. The app uses no private APIs: it never reads other apps' content itself, it only sees what the user mirrors to the board.++Demo video of the full flow (connect, mirror, run a task, replay): <VIDEO_URL>++Without a board: turn on Settings › Demo data, then quit and reopen the app. It fakes a board, a finished run and the whole setup, so every screen can be reviewed.++The model endpoint is set by the user (any OpenAI-compatible vision API). For review, use: <REVIEW_ENDPOINT_OR_REMOVE>diff --git a/ios/project.yml b/ios/project.ymlindex afa150a..7bc39d7 100644--- a/ios/project.yml+++ b/ios/project.yml@@ -30,6 +30,9 @@ targets:CFBundleDisplayName: ESP32 AgentCFBundleDevelopmentRegion: enCFBundleLocalizations: [en, zh-Hans]+ CFBundleShortVersionString: $(MARKETING_VERSION)+ CFBundleVersion: $(CURRENT_PROJECT_VERSION)+ ITSAppUsesNonExemptEncryption: false # HTTPS onlyUILaunchScreen:UIColorName: LaunchBackgroundUIImageName: LaunchLogo@@ -73,8 +76,8 @@ targets:CFBundleDisplayName: ESP32 AgentCFBundleDevelopmentRegion: enCFBundleLocalizations: [en, zh-Hans]- CFBundleShortVersionString: "1.0"- CFBundleVersion: "1"+ CFBundleShortVersionString: $(MARKETING_VERSION)+ CFBundleVersion: $(CURRENT_PROJECT_VERSION)IAAppGroup: group.$(IA_BUNDLE_ID)NSExtension:NSExtensionPointIdentifier: com.apple.widgetkit-extension