# simulator_input

> 다른 입력 도구가 다루지 않는 제스처를 위해 팀 Simulator에 원시 입력 이벤트 하나를 보내는 MCP 도구입니다.

Source: https://air.build/ko/docs/mcp-tools/simulator_input/

`simulator_input`은 실행 중인 팀 Simulator에 원시 입력 이벤트 하나를 보냅니다. 다른 도구가 하지 않는 일, 즉 여러 호출에 걸쳐 누르고 있는 터치, 두 손가락 핀치, 화면 가장자리에서 안쪽으로 스와이프하기에 쓰세요. 제스처 하나는 여러 이벤트(누르기, 한 번 이상의 이동, 떼기)로 이루어지므로, 순서대로 보내거나 [simulator_batch](https://air.build/ko/docs/mcp-tools/simulator_batch/)의 `input` 단계로 한꺼번에 보내세요. 지점은 [화면 좌표](https://air.build/ko/docs/mcp-tools/simulator_screen/#coordinates)를 사용하며 요소와 대조하지 않습니다. 일상적인 탭, 스와이프, 입력, 버튼에는 전용 도구를 쓰세요.

| 읽기 전용 | 파괴적 | 멱등 |
| --- | --- | --- |
| 아니요 | 아니요 | 아니요 |

## 이벤트

`event`는 `type`과 그 유형의 필드를 가진 객체입니다.

| `type` | 필드 | 설명 |
| --- | --- | --- |
| `touch1-down`, `touch1-move`, `touch1-up`, `touch1-cancel` | `x`, `y`, `edge`(선택 사항) | 손가락 하나: 누르기, 이동, 떼기, 취소. `edge`(예: `left`, `bottom`)를 주면 화면의 그 가장자리에서 안쪽으로 스와이프합니다 |
| `touch2-down`, `touch2-move`, `touch2-up`, `touch2-cancel` | `x1`, `y1`, `x2`, `y2` | 두 손가락을 동시에. 핀치나 두 손가락 회전에 씁니다 |
| `tap` | `x`, `y`, `duration`(선택 사항) | 탭. 좌표를 쓴 [simulator_tap](https://air.build/ko/docs/mcp-tools/simulator_tap/)과 같습니다 |
| `swipe` | `startX`, `startY`, `endX`, `endY`, `duration`(선택 사항) | [simulator_swipe](https://air.build/ko/docs/mcp-tools/simulator_swipe/)와 같습니다 |
| `type` | `text` | [simulator_type_text](https://air.build/ko/docs/mcp-tools/simulator_type_text/)와 같습니다 |
| `key` | `code`, `modifiers`, `duration`(선택 사항) | [simulator_key](https://air.build/ko/docs/mcp-tools/simulator_key/)와 같습니다 |
| `button` | `button`, `duration`(선택 사항) | [simulator_button](https://air.build/ko/docs/mcp-tools/simulator_button/)과 같습니다 |
| `orientation` | `orientation` | [simulator_rotate](https://air.build/ko/docs/mcp-tools/simulator_rotate/)와 같습니다 |
| `fold` | `degrees`(0~180) | 폴더블 기기의 힌지를 움직입니다. [simulator_fold](https://air.build/ko/docs/mcp-tools/simulator_fold/)와 같습니다 |

모든 포인터 이벤트(`touch1-*`, `touch2-*`, `tap`, `swipe`)는 선택 사항인 `width`와 `height`도 받습니다. 이를 보내면 기기 화면 대신 그 크기의 틀 안에서 좌표를 주게 되며, 좌표는 화면에 맞게 조정됩니다. 모든 이벤트에 [simulator_displays](https://air.build/ko/docs/mcp-tools/simulator_displays/)의 디스플레이 `screenId`인 `display`를 넣어 폴더블 기기의 디스플레이 하나를 지정할 수 있습니다.

## 입력

| 입력 | 유형 | 필수 | 기본값 | 설명 |
| --- | --- | --- | --- | --- |
| `teamId` | 문자열 (UUID) | 예 | — | 팀. [list_teams](https://air.build/ko/docs/mcp-tools/list_teams/)에서 가져옵니다 |
| `simulator` | string | 아니요 | 팀의 기본 기기 | 어떤 기기인지. [list_simulators](https://air.build/ko/docs/mcp-tools/list_simulators/#result)의 `id` |
| `event` | `type`이 있는 객체 | 예 | — | [이벤트](https://air.build/ko/docs/mcp-tools/simulator_input/#events) |

## 결과

| 필드 | 내용 |
| --- | --- |
| `ok` | `true` |

```json
{ "ok": true }
```

## 오류

| Message | 발생 조건 | 해결 방법 |
| --- | --- | --- |
| event is an object with a "type". | `event`가 없거나, 객체가 아니거나, `type`이 없음 | `type`이 있는 객체를 보내세요 |
| Failed to deserialize the JSON body into the target type: _…_ | 알 수 없는 `type`, 빠진 필드, 또는 유형이 잘못된 필드 | 메시지에 나온 필드를 고치세요 |

모든 Simulator 도구가 반환할 수 있는 오류도 반환합니다. [start_simulator](https://air.build/ko/docs/mcp-tools/start_simulator/#device-errors)를 참고하세요.

## 예시

왼쪽 가장자리에서 안쪽으로 스와이프하기(뒤로), 세 번의 호출:

```json
{"name": "simulator_input", "arguments": {"teamId": "00000000-0000-0000-0000-000000000000", "event": {"type": "touch1-down", "x": 2, "y": 400, "edge": "left"}}}
```

```json
{"name": "simulator_input", "arguments": {"teamId": "00000000-0000-0000-0000-000000000000", "event": {"type": "touch1-move", "x": 200, "y": 400, "edge": "left"}}}
```

```json
{"name": "simulator_input", "arguments": {"teamId": "00000000-0000-0000-0000-000000000000", "event": {"type": "touch1-up", "x": 300, "y": 400, "edge": "left"}}}
```
