# simulator_scroll_to

> チームのシミュレータの画面を、要素が見えるまでタップせずにスクロールする MCP ツールです。

Source: https://air.build/ja/docs/mcp-tools/simulator_scroll_to/

`simulator_scroll_to` は、チームの動作中のシミュレータをスワイプで 1 回ずつスクロールし、要素が画面に完全に表示されたら止まります。要素はタップしないので、続けて [simulator_tap](https://air.build/ja/docs/mcp-tools/simulator_tap/) を使ってください。すでに画面にある要素ではスワイプは不要です。各スワイプはスクロール領域の半分までしか動かさず、ゆっくり離すので、コンテンツが勢いで要素を通り過ぎることはありません。探索は、要素が表示されたとき、コンテンツが動かなくなったとき（リストの終わり）、`maxScrolls` 回スワイプしたとき、または `timeoutSeconds` が経過したときに終わります。探索に失敗すると、画面がスクロールしたままになることがあります。1 回の探索は最長 25 秒です。続けるにはもう一度呼び出してください。

`direction` は、指が動く方向ではなく、コンテンツがある方向を示します。`down`（デフォルト）は下にあるものを表示するので、指は上へ動きます。画面に複数のスクロール領域がある場合は、スクロールする領域を `withinId` か `withinText` で指定してください。表示されている要素のちょうど 1 つに一致する必要があります。

| 読み取り専用 | 破壊的 | 冪等 |
| --- | --- | --- |
| いいえ | いいえ | いいえ |

## 入力

| 入力 | 型 | 必須 | デフォルト | 内容 |
| --- | --- | --- | --- | --- |
| `teamId` | 文字列（UUID） | はい | — | チーム。[list_teams](https://air.build/ja/docs/mcp-tools/list_teams/) から取得 |
| `simulator` | string | いいえ | チームのデフォルトのデバイス | どのデバイスか。[list_simulators](https://air.build/ja/docs/mcp-tools/list_simulators/#result) の `id` で指定します |
| `text` | string | `text`、`id`、`nodeId` のいずれか | — | 要素の表示テキスト。[セレクタ](https://air.build/ja/docs/mcp-tools/simulator_find/#selector) と同じです |
| `id` | string | `text`、`id`、`nodeId` のいずれか | — | 要素の `accessibilityIdentifier` |
| `nodeId` | string | `text`、`id`、`nodeId` のいずれか | — | [simulator_describe_ui](https://air.build/ja/docs/mcp-tools/simulator_describe_ui/) の `nodeId` |
| `exact` | boolean | いいえ | `false` | `text` が完全に一致する必要があります |
| `direction` | 文字列：`down`、`up`、`left`、または `right` | いいえ | `down` | 表示したいコンテンツがある方向 |
| `withinId` | string | いいえ | 画面全体 | スクロール領域。その `accessibilityIdentifier` で指定します |
| `withinText` | string | いいえ | 画面全体 | スクロール領域。そのテキストで指定します |
| `withinExact` | boolean | いいえ | `false` | `withinText` が完全に一致する必要があります |
| `timeoutSeconds` | 数値、0〜25 | いいえ | `20` | 探す時間（秒） |
| `maxScrolls` | 整数、1〜100 | いいえ | `25` | スワイプの最大回数 |

## 結果

| フィールド | 内容 |
| --- | --- |
| `ok` | `true` |
| `element`, `point`, `exact`, `matchCount`, `excluded` | 見つかった要素。[simulator_tap](https://air.build/ja/docs/mcp-tools/simulator_tap/#result) と同じです |
| `scrolls` | スワイプした回数 |
| `elapsedMs` | かかった時間（ミリ秒） |

```json
{ "ok": true, "element": { "label": "Settings", "role": "AXCell", "frame": { "x": 0, "y": 610, "width": 402, "height": 44 }, "enabled": true, "interactive": true, "adjustable": false },
  "point": { "x": 201, "y": 632 }, "exact": true, "matchCount": 1, "excluded": [], "scrolls": 3, "elapsedMs": 4200 }
```

## エラー

| メッセージ | 発生する状況 | 対処 |
| --- | --- | --- |
| Name the element: text, id or nodeId. | 3 つのどれも指定されていない | 1 つ追加してください |
| direction must be one of down, up, left, right. | それ以外の `direction` | 4 つのうちのどれかを使ってください |
| scroll content stopped changing after _n_ swipes without revealing _selector_; reached the end or the gesture did not scroll | コンテンツの終わりに達した、または領域がスクロールしない | 別の `direction` を試すか、スクロール領域を指定してください |
| _selector_ not visible after _n_ scroll attempts | `maxScrolls` に達した | もう一度呼び出すか、`maxScrolls` を増やしてください |
| scroll-to _selector_ did not happen within _n_s | 時間切れ | 続けるにはもう一度呼び出してください |
| scroll container _selector_ must match exactly one visible element (found _n_) | `withinId` / `withinText` が何にも一致しない、または複数に一致する | 絞り込んでください |
| max-scrolls must be between 1 and 100 | `maxScrolls` が範囲外 | 1〜100 にしてください |

このほか、すべてのシミュレータツールが返す可能性のあるエラーがあります。[start_simulator](https://air.build/ja/docs/mcp-tools/start_simulator/#device-errors) を参照してください。

## 例

```json
{"name": "simulator_scroll_to", "arguments": {"teamId": "00000000-0000-0000-0000-000000000000", "text": "Settings", "direction": "down"}}
```
