simulator_launch_app
這個 MCP 工具會依 bundle ID 啟動團隊模擬器上已安裝的 App,並把它帶到前景。
simulator_launch_app 會依 bundle ID(來自 simulator_apps)啟動團隊正在執行的模擬器上已安裝的 App,並把它帶到前景。它不會安裝任何內容:不存在的 App 會以 app is not installed on this device 失敗。它不會刪除任何內容。
| 唯讀 | 破壞性 | 冪等 |
|---|---|---|
| 否 | 否 | 否 |
輸入
| 輸入 | 類型 | 必填 | 預設值 | 作用 |
|---|---|---|---|---|
teamId |
字串(UUID) | 是 | — | 團隊,來自 list_teams |
simulator |
string | 否 | 團隊的預設裝置 | 哪種裝置,使用 list_simulators 中的 id |
bundleId |
string | 是 | — | App 的 bundle ID,例如 com.example.notes |
結果
| 欄位 | 說明 |
|---|---|
ok |
true |
env |
[]:不傳遞環境變數 |
args |
0:不傳遞啟動參數 |
{ "ok": true, "env": [], "args": 0 }錯誤
| 訊息 | 何時出現 | 處理方式 |
|---|---|---|
| bundleId is required. | 缺少 bundleId,或它為空 |
傳送 bundle ID |
| app is not installed on this device | 沒有安裝該 bundle ID 的 App | 檢查 simulator_apps,或用 simulator_install_app 安裝 |
另外還有每個模擬器工具都可能傳回的錯誤:請參閱 start_simulator。
範例
{"name": "simulator_launch_app", "arguments": {"teamId": "00000000-0000-0000-0000-000000000000", "bundleId": "com.example.notes"}}