# simulator_button

> 這個 MCP 工具會按下團隊模擬器上的硬體按鈕：主畫面、鎖定、音量或 App 切換器。

Source: https://air.build/tw/docs/mcp-tools/simulator_button/

`simulator_button` 會在團隊正在執行的模擬器上按下一個硬體按鈕並放開：`home` 回到主畫面，`lock`（也稱為 `power`）鎖定或喚醒螢幕，`volume-up` 和 `volume-down` 調整音量，`app-switcher` 開啟 App 切換器。`duration` 會按住按鈕，例如長按 `lock`。它不會結束或啟動 App；若要讓 App 回到前景，請使用 [simulator_launch_app](https://air.build/tw/docs/mcp-tools/simulator_launch_app/)。

| 唯讀 | 破壞性 | 冪等 |
| --- | --- | --- |
| 否 | 否 | 否 |

## 輸入

| 輸入 | 類型 | 必填 | 預設值 | 作用 |
| --- | --- | --- | --- | --- |
| `teamId` | 字串（UUID） | 是 | — | 團隊，來自 [list_teams](https://air.build/tw/docs/mcp-tools/list_teams/) |
| `simulator` | string | 否 | 團隊的預設裝置 | 哪種裝置，使用 [list_simulators](https://air.build/tw/docs/mcp-tools/list_simulators/#result) 中的 `id` |
| `button` | 字串：`home`、`lock`、`power`、`volume-up`、`volume-down`、`app-switcher` | 是 | — | 按鈕。`power` 與 `lock` 相同 |
| `duration` | 數字，0 到 60 | 否 | 短按 | 按住的秒數 |

## 結果

| 欄位 | 說明 |
| --- | --- |
| `ok` | `true` |

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

## 錯誤

| 訊息 | 何時出現 | 處理方式 |
| --- | --- | --- |
| button is required. | 缺少 `button` | 傳送一個按鈕 |
| button must be one of home, lock, power, volume-up, volume-down, app-switcher. | 其他名稱 | 使用以下之一 |
| duration must be a number from 0 to 60. | `duration` 超出範圍 | 傳送 0 到 60 |

另外還有每個模擬器工具都可能傳回的錯誤：請參閱 [start_simulator](https://air.build/tw/docs/mcp-tools/start_simulator/#device-errors)。

## 範例

```json
{"name": "simulator_button", "arguments": {"teamId": "00000000-0000-0000-0000-000000000000", "button": "home"}}
```
