{"title":"자동화된 iOS 앱 테스트","slug":"automated-testing-ios","category":"guides","summary":"Synapse와 Computer Control API를 사용하여 Simulator를 통해 iOS 앱 테스트를 자동화합니다.","audience":["human","llm"],"tags":["guide","ios","testing","automation"],"difficulty":"advanced","updated":"2026-06-27","word_count":265,"read_minutes":1,"lang":"ko","translated":true,"requested_lang":"ko","content_markdown":"\n# 자동화된 iOS 앱 테스트\n\nSynapse의 메모리 시스템을 Computer Control API와 결합하여 LLM 기반 iOS 앱\n테스트를 구축하십시오. LLM은 테스트 시나리오를 기억하고, 과거 실패로부터\n학습하며, UI 변경에 적응합니다.\n\n## 아키텍처\n\n```\n┌──────────────┐    commands    ┌──────────────┐    screenshots    ┌──────────────┐\n│  LLM Agent   │ ─────────────▶│  Synapse     │ ────────────────▶ │  iOS Sim     │\n│  (Claude)    │               │  Computer    │ ◀──────────────── │  (via agent) │\n└──────────────┘               │  Control     │    results        └──────────────┘\n       │                       └──────────────┘\n       │ store/recall\n       ▼\n┌──────────────┐\n│  Memories    │ (test scenarios, past failures, UI patterns)\n└──────────────┘\n```\n\n## 사전 요구 사항\n\n- Synapse 계정 및 Mind Key\n- Claude Desktop에 구성된 Synapse MCP 서버\n- `screen-remote-agent`가 설치된 iOS Simulator\n- Synapse에 등록된 컴퓨터 ([Computer Control API](/docs/api/computers) 참조)\n\n## 1단계: Simulator 컴퓨터 등록\n\niOS Simulator를 실행 중인 Mac에서:\n\n```bash\n# Get install code from Synapse\ncurl -X POST https://synapse.schaefer.zone/computers/install-code \\\n  -H \"Authorization: Bearer YOUR_MIND_KEY\" \\\n  -d '{\"computer_name\":\"ios-sim\"}'\n# → { \"install_code\": \"ic_...\" }\n\n# Run screen-remote-agent on the Mac\n# (uses the install code to register)\n```\n\n## 2단계: 메모리에 테스트 시나리오 저장\n\n재사용 가능한 테스트 시나리오를 메모리로 저장:\n\n```python\nimport requests\n\ndef store_test_scenario(name, steps, app):\n    requests.post(f\"{URL}/memory\",\n        headers={\"Authorization\": f\"Bearer {MIND_KEY}\"},\n        json={\n            \"category\": \"skill\",\n            \"key\": f\"test_scenario_{name}\",\n            \"content\": f\"App: {app}\\nSteps:\\n\" + \"\\n\".join(steps),\n            \"tags\": [\"test\", \"ios\", app],\n            \"priority\": \"high\"\n        })\n\nstore_test_scenario(\"login_flow\", [\n    \"Launch app\",\n    \"Tap email field\",\n    \"Type test@example.com\",\n    \"Tap password field\",\n    \"Type password123\",\n    \"Tap Login button\",\n    \"Verify home screen appears\"\n], \"MyApp\")\n```\n\n## 3단계: LLM 기반 테스트 실행\n\nClaude Desktop에서 (Synapse MCP 구성된 상태):\n\n```\nRun the login_flow test scenario on the iOS Simulator.\nTake a screenshot after each step and verify the expected UI.\nIf any step fails, store the failure as a memory so we can\navoid it next time.\n```\n\nClaude는 다음을 수행합니다:\n\n1. `memory_search`를 호출하여 `test_scenario_login_flow` 메모리 찾기\n2. `computer_screenshot`을 호출하여 현재 상태 보기\n3. `computer_command_queue` (click, type)를 통해 각 단계 실행\n4. 스크린샷을 통해 결과 검증\n5. 모든 실패를 `mistake` 메모리로 저장\n\n## 4단계: 자가 치유 테스트\n\n테스트가 실패하면 실패와 복구를 저장:\n\n```python\ndef store_test_failure(scenario, step, error, recovery):\n    requests.post(f\"{URL}/memory\",\n        headers={\"Authorization\": f\"Bearer {MIND_KEY}\"},\n        json={\n            \"category\": \"mistake\",\n            \"key\": f\"failure_{scenario}_{step}\",\n            \"content\": f\"Scenario: {scenario}\\nStep: {step}\\nError: {error}\\nRecovery: {recovery}\",\n            \"tags\": [\"test\", \"failure\", \"ios\", scenario],\n            \"priority\": \"high\"\n        })\n\n# Example\nstore_test_failure(\"login_flow\", \"tap_login\",\n    \"Login button not found at expected coordinates\",\n    \"Button moved due to new logo. Search by accessibility label instead.\")\n```\n\n다음에 LLM이 테스트를 실행할 때, 실패를 회상하고 복구를 자동으로\n적용합니다.\n\n## 5단계: 테스트 결과 추적\n\n테스트 실행을 작업으로 추적:\n\n```python\ndef track_test_run(scenario, status, duration):\n    requests.post(f\"{URL}/mind/task\",\n        headers={\"Authorization\": f\"Bearer {MIND_KEY}\",\n                 \"Content-Type\": \"application/json\"},\n        json={\n            \"title\": f\"Test: {scenario}\",\n            \"description\": f\"Status: {status}, Duration: {duration}s\",\n            \"priority\": \"normal\"\n        })\n```\n\n## 일반적인 명령\n\n| 작업 | 명령 |\n|--------|---------|\n| Simulator 실행 | `xcrun simctl launch booted com.example.app` |\n| 스크린샷 | `computer_screenshot` (Synapse MCP를 통해) |\n| (x,y) 탭 | `computer_command_queue {type:\"click\", payload:{x,y}}` |\n| 텍스트 입력 | `computer_command_queue {type:\"type\", payload:{text:\"...\"}}` |\n| Home 버튼 | `computer_command_queue {type:\"key\", payload:{keys:[\"Cmd\",\"Shift\",\"H\"]}}` |\n\n## 모범 사례\n\n> [!TIP]\n> - **UI 좌표를 메모리로 저장** — UI는 변경되지만, LLM이 다시 학습할 수 있음\n> - **접근성 라벨 사용** — 좌표보다 안정적\n> - **테스트 데이터를 분리하여 저장** — 사용자 이름, 비밀번호에 변수 사용\n> - **깨끗한 상태에서 테스트 실행** — 실행 간 Simulator 재설정\n> - **실패에 대한 스크린샷 로그** — 디버깅에 유용\n\n## 다음 단계\n\n- [자가 치유 테스트](/docs/guides/self-healing-tests)\n- [Computer Control API](/docs/api/computers)\n- [메모리 모범 사례](/docs/guides/memory-best-practices)\n","content_html":"<h1>자동화된 iOS 앱 테스트</h1>\n<p>Synapse의 메모리 시스템을 Computer Control API와 결합하여 LLM 기반 iOS 앱\n테스트를 구축하십시오. LLM은 테스트 시나리오를 기억하고, 과거 실패로부터\n학습하며, UI 변경에 적응합니다.</p>\n<h2>아키텍처</h2>\n<pre><code class=\"hljs language-plaintext\">┌──────────────┐    commands    ┌──────────────┐    screenshots    ┌──────────────┐\n│  LLM Agent   │ ─────────────▶│  Synapse     │ ────────────────▶ │  iOS Sim     │\n│  (Claude)    │               │  Computer    │ ◀──────────────── │  (via agent) │\n└──────────────┘               │  Control     │    results        └──────────────┘\n       │                       └──────────────┘\n       │ store/recall\n       ▼\n┌──────────────┐\n│  Memories    │ (test scenarios, past failures, UI patterns)\n└──────────────┘</code></pre><h2>사전 요구 사항</h2>\n<ul>\n<li>Synapse 계정 및 Mind Key</li>\n<li>Claude Desktop에 구성된 Synapse MCP 서버</li>\n<li><code>screen-remote-agent</code>가 설치된 iOS Simulator</li>\n<li>Synapse에 등록된 컴퓨터 (<a href=\"/docs/api/computers\">Computer Control API</a> 참조)</li>\n</ul>\n<h2>1단계: Simulator 컴퓨터 등록</h2>\n<p>iOS Simulator를 실행 중인 Mac에서:</p>\n<pre><code class=\"hljs language-bash\"><span class=\"hljs-comment\"># Get install code from Synapse</span>\ncurl -X POST https://synapse.schaefer.zone/computers/install-code \\\n  -H <span class=\"hljs-string\">&quot;Authorization: Bearer YOUR_MIND_KEY&quot;</span> \\\n  -d <span class=\"hljs-string\">&#x27;{&quot;computer_name&quot;:&quot;ios-sim&quot;}&#x27;</span>\n<span class=\"hljs-comment\"># → { &quot;install_code&quot;: &quot;ic_...&quot; }</span>\n\n<span class=\"hljs-comment\"># Run screen-remote-agent on the Mac</span>\n<span class=\"hljs-comment\"># (uses the install code to register)</span></code></pre><h2>2단계: 메모리에 테스트 시나리오 저장</h2>\n<p>재사용 가능한 테스트 시나리오를 메모리로 저장:</p>\n<pre><code class=\"hljs language-python\"><span class=\"hljs-keyword\">import</span> requests\n\n<span class=\"hljs-keyword\">def</span> <span class=\"hljs-title function_\">store_test_scenario</span>(<span class=\"hljs-params\">name, steps, app</span>):\n    requests.post(<span class=\"hljs-string\">f&quot;<span class=\"hljs-subst\">{URL}</span>/memory&quot;</span>,\n        headers={<span class=\"hljs-string\">&quot;Authorization&quot;</span>: <span class=\"hljs-string\">f&quot;Bearer <span class=\"hljs-subst\">{MIND_KEY}</span>&quot;</span>},\n        json={\n            <span class=\"hljs-string\">&quot;category&quot;</span>: <span class=\"hljs-string\">&quot;skill&quot;</span>,\n            <span class=\"hljs-string\">&quot;key&quot;</span>: <span class=\"hljs-string\">f&quot;test_scenario_<span class=\"hljs-subst\">{name}</span>&quot;</span>,\n            <span class=\"hljs-string\">&quot;content&quot;</span>: <span class=\"hljs-string\">f&quot;App: <span class=\"hljs-subst\">{app}</span>\\nSteps:\\n&quot;</span> + <span class=\"hljs-string\">&quot;\\n&quot;</span>.join(steps),\n            <span class=\"hljs-string\">&quot;tags&quot;</span>: [<span class=\"hljs-string\">&quot;test&quot;</span>, <span class=\"hljs-string\">&quot;ios&quot;</span>, app],\n            <span class=\"hljs-string\">&quot;priority&quot;</span>: <span class=\"hljs-string\">&quot;high&quot;</span>\n        })\n\nstore_test_scenario(<span class=\"hljs-string\">&quot;login_flow&quot;</span>, [\n    <span class=\"hljs-string\">&quot;Launch app&quot;</span>,\n    <span class=\"hljs-string\">&quot;Tap email field&quot;</span>,\n    <span class=\"hljs-string\">&quot;Type test@example.com&quot;</span>,\n    <span class=\"hljs-string\">&quot;Tap password field&quot;</span>,\n    <span class=\"hljs-string\">&quot;Type password123&quot;</span>,\n    <span class=\"hljs-string\">&quot;Tap Login button&quot;</span>,\n    <span class=\"hljs-string\">&quot;Verify home screen appears&quot;</span>\n], <span class=\"hljs-string\">&quot;MyApp&quot;</span>)</code></pre><h2>3단계: LLM 기반 테스트 실행</h2>\n<p>Claude Desktop에서 (Synapse MCP 구성된 상태):</p>\n<pre><code class=\"hljs language-plaintext\">Run the login_flow test scenario on the iOS Simulator.\nTake a screenshot after each step and verify the expected UI.\nIf any step fails, store the failure as a memory so we can\navoid it next time.</code></pre><p>Claude는 다음을 수행합니다:</p>\n<ol>\n<li><code>memory_search</code>를 호출하여 <code>test_scenario_login_flow</code> 메모리 찾기</li>\n<li><code>computer_screenshot</code>을 호출하여 현재 상태 보기</li>\n<li><code>computer_command_queue</code> (click, type)를 통해 각 단계 실행</li>\n<li>스크린샷을 통해 결과 검증</li>\n<li>모든 실패를 <code>mistake</code> 메모리로 저장</li>\n</ol>\n<h2>4단계: 자가 치유 테스트</h2>\n<p>테스트가 실패하면 실패와 복구를 저장:</p>\n<pre><code class=\"hljs language-python\"><span class=\"hljs-keyword\">def</span> <span class=\"hljs-title function_\">store_test_failure</span>(<span class=\"hljs-params\">scenario, step, error, recovery</span>):\n    requests.post(<span class=\"hljs-string\">f&quot;<span class=\"hljs-subst\">{URL}</span>/memory&quot;</span>,\n        headers={<span class=\"hljs-string\">&quot;Authorization&quot;</span>: <span class=\"hljs-string\">f&quot;Bearer <span class=\"hljs-subst\">{MIND_KEY}</span>&quot;</span>},\n        json={\n            <span class=\"hljs-string\">&quot;category&quot;</span>: <span class=\"hljs-string\">&quot;mistake&quot;</span>,\n            <span class=\"hljs-string\">&quot;key&quot;</span>: <span class=\"hljs-string\">f&quot;failure_<span class=\"hljs-subst\">{scenario}</span>_<span class=\"hljs-subst\">{step}</span>&quot;</span>,\n            <span class=\"hljs-string\">&quot;content&quot;</span>: <span class=\"hljs-string\">f&quot;Scenario: <span class=\"hljs-subst\">{scenario}</span>\\nStep: <span class=\"hljs-subst\">{step}</span>\\nError: <span class=\"hljs-subst\">{error}</span>\\nRecovery: <span class=\"hljs-subst\">{recovery}</span>&quot;</span>,\n            <span class=\"hljs-string\">&quot;tags&quot;</span>: [<span class=\"hljs-string\">&quot;test&quot;</span>, <span class=\"hljs-string\">&quot;failure&quot;</span>, <span class=\"hljs-string\">&quot;ios&quot;</span>, scenario],\n            <span class=\"hljs-string\">&quot;priority&quot;</span>: <span class=\"hljs-string\">&quot;high&quot;</span>\n        })\n\n<span class=\"hljs-comment\"># Example</span>\nstore_test_failure(<span class=\"hljs-string\">&quot;login_flow&quot;</span>, <span class=\"hljs-string\">&quot;tap_login&quot;</span>,\n    <span class=\"hljs-string\">&quot;Login button not found at expected coordinates&quot;</span>,\n    <span class=\"hljs-string\">&quot;Button moved due to new logo. Search by accessibility label instead.&quot;</span>)</code></pre><p>다음에 LLM이 테스트를 실행할 때, 실패를 회상하고 복구를 자동으로\n적용합니다.</p>\n<h2>5단계: 테스트 결과 추적</h2>\n<p>테스트 실행을 작업으로 추적:</p>\n<pre><code class=\"hljs language-python\"><span class=\"hljs-keyword\">def</span> <span class=\"hljs-title function_\">track_test_run</span>(<span class=\"hljs-params\">scenario, status, duration</span>):\n    requests.post(<span class=\"hljs-string\">f&quot;<span class=\"hljs-subst\">{URL}</span>/mind/task&quot;</span>,\n        headers={<span class=\"hljs-string\">&quot;Authorization&quot;</span>: <span class=\"hljs-string\">f&quot;Bearer <span class=\"hljs-subst\">{MIND_KEY}</span>&quot;</span>,\n                 <span class=\"hljs-string\">&quot;Content-Type&quot;</span>: <span class=\"hljs-string\">&quot;application/json&quot;</span>},\n        json={\n            <span class=\"hljs-string\">&quot;title&quot;</span>: <span class=\"hljs-string\">f&quot;Test: <span class=\"hljs-subst\">{scenario}</span>&quot;</span>,\n            <span class=\"hljs-string\">&quot;description&quot;</span>: <span class=\"hljs-string\">f&quot;Status: <span class=\"hljs-subst\">{status}</span>, Duration: <span class=\"hljs-subst\">{duration}</span>s&quot;</span>,\n            <span class=\"hljs-string\">&quot;priority&quot;</span>: <span class=\"hljs-string\">&quot;normal&quot;</span>\n        })</code></pre><h2>일반적인 명령</h2>\n<table>\n<thead>\n<tr>\n<th>작업</th>\n<th>명령</th>\n</tr>\n</thead>\n<tbody><tr>\n<td>Simulator 실행</td>\n<td><code>xcrun simctl launch booted com.example.app</code></td>\n</tr>\n<tr>\n<td>스크린샷</td>\n<td><code>computer_screenshot</code> (Synapse MCP를 통해)</td>\n</tr>\n<tr>\n<td>(x,y) 탭</td>\n<td><code>computer_command_queue {type:&quot;click&quot;, payload:{x,y}}</code></td>\n</tr>\n<tr>\n<td>텍스트 입력</td>\n<td><code>computer_command_queue {type:&quot;type&quot;, payload:{text:&quot;...&quot;}}</code></td>\n</tr>\n<tr>\n<td>Home 버튼</td>\n<td><code>computer_command_queue {type:&quot;key&quot;, payload:{keys:[&quot;Cmd&quot;,&quot;Shift&quot;,&quot;H&quot;]}}</code></td>\n</tr>\n</tbody></table>\n<h2>모범 사례</h2>\n<div class=\"callout callout-ok\"></div><h2>다음 단계</h2>\n<ul>\n<li><a href=\"/docs/guides/self-healing-tests\">자가 치유 테스트</a></li>\n<li><a href=\"/docs/api/computers\">Computer Control API</a></li>\n<li><a href=\"/docs/guides/memory-best-practices\">메모리 모범 사례</a></li>\n</ul>\n","urls":{"html":"/docs/guides/automated-testing-ios","text":"/docs/guides/automated-testing-ios?format=text","json":"/docs/guides/automated-testing-ios?format=json","llm":"/docs/guides/automated-testing-ios?format=llm"},"translations_available":["en","zh","hi","es","fr","ar","pt","ru","ja","de","it","ko","nl","pl","tr","sv","vi","th","id","uk"]}