appstore_upload_screenshots
從聊天附件、https 網址或團隊正在執行的模擬器上傳一種語言的 App Store 截圖,並等待 Apple 接受。
為正在準備的版本(否則為已上架的版本)上傳一種語言的 App Store 截圖,並等待 Apple 逐張接受。每張截圖都來自以下三處之一:
- 聊天附件:某人傳送的圖片,以
attachmentId指定(請參閱 get_attachment)。 - https 網址:從該網址下載圖片。
- 團隊的模擬器:目前的畫面,立即擷取。模擬器必須正在執行(請參閱 start_simulator)。6.9 吋 iPhone 模擬器(iPhone 17 Pro Max)能提供 Apple 要求的尺寸。
圖片必須是 PNG 或 JPEG。除非傳送了 displayType,否則顯示尺寸會依每張圖片的像素判斷(見下表)。截圖會加在既有截圖之後;使用 replace 時,會先刪除該尺寸的既有截圖。每種尺寸 Apple 最多接受 10 張。版本中還沒有該語言時,會新增它。呼叫兩次會上傳兩次截圖。
這個工具可能需要幾分鐘。用戶端接受串流時,它會以帶有進度的串流回應(請參閱 伺服器與登入)。
| 唯讀 | 破壞性 | 冪等 |
|---|---|---|
| 否 | 否 | 否 |
輸入
| 輸入 | 類型 | 必填 | 預設值 | 作用 |
|---|---|---|---|---|
teamId |
字串(UUID) | yes | — | 團隊,來自 list_teams。 |
projectId |
字串(UUID) | 與 appId 二擇一 |
— | 這個 App 所屬的專案,來自 list_projects:這是指定 App 的一般方式。App 是 App Store Connect 上 bundle ID 與該專案建置的 bundle ID 相同的那一個。兩者都傳送時,會使用 projectId。 |
appId |
string | 與 projectId 二擇一 |
— | 來自 appstore_list_apps 的 App Store Connect App ID,用於沒有專案建置的 App。 |
appleTeamId |
字串(UUID) | no | 所有已連結的 Apple 團隊 | 團隊的其中一個 Apple 團隊,來自 appstore_list_apple_teams。搭配 appId 時,只會在這個 Apple 團隊中尋找該 App。搭配 projectId 時不需要:由專案的 App 決定。 |
platform |
字串:IOS、MAC_OS、TV_OS、VISION_OS |
no | IOS |
哪個平台的 App Store 版本。 |
locale |
string | no | App 的主要語言 | 語言,例如 en-US。 |
displayType |
字串,下列顯示尺寸之一 | no | 依每張圖片判斷 | 本次呼叫中所有圖片使用的 Apple 顯示尺寸。 |
screenshots |
包含 1 到 10 個物件的陣列 | yes | — | 圖片,依順序排列。每項恰好包含 attachmentId、url 或 simulator 其中之一。 |
screenshots[].attachmentId |
字串(UUID) | 三者之一 | — | 聊天附件:某人傳送的圖片。 |
screenshots[].url |
字串(https 網址) | 三者之一 | — | 要下載的圖片。僅限 https:// 網址。 |
screenshots[].simulator |
字串或 null | 三者之一 | — | 立即擷取團隊正在執行的模擬器:它的裝置 ID 來自 list_simulators,或以 null 表示預設裝置。 |
replace |
boolean | no | false | 先刪除相同尺寸的既有截圖。 |
顯示尺寸,以及辨識每種尺寸所依據的像素尺寸(直向,或轉為橫向的相同尺寸):
displayType |
裝置 | 辨識依據 |
|---|---|---|
APP_IPHONE_67 |
iPhone 6.9 吋 | 1320 × 2868, 1290 × 2796, 1260 × 2736 |
APP_IPHONE_65 |
iPhone 6.5 吋 | 1284 × 2778, 1242 × 2688 |
APP_IPHONE_61 |
iPhone 6.1 吋 | 1206 × 2622, 1179 × 2556, 1170 × 2532 |
APP_IPHONE_58 |
iPhone 5.8 吋 | 1125 × 2436, 1080 × 2340 |
APP_IPHONE_55 |
iPhone 5.5 吋 | 1242 × 2208 |
APP_IPHONE_47 |
iPhone 4.7 吋 | 750 × 1334 |
APP_IPHONE_40 |
iPhone 4 吋 | 僅搭配 displayType |
APP_IPAD_PRO_3GEN_129 |
iPad 13 吋 | 2064 × 2752, 2048 × 2732 |
APP_IPAD_PRO_3GEN_11 |
iPad 11 吋 | 1668 × 2420, 1668 × 2388, 1640 × 2360, 1488 × 2266 |
APP_IPAD_PRO_129 |
iPad Pro 12.9 吋(第 2 代) | 僅搭配 displayType |
APP_IPAD_105 |
iPad 10.5 吋 | 僅搭配 displayType |
APP_IPAD_97 |
iPad 9.7 吋 | 僅搭配 displayType |
APP_DESKTOP |
Mac | 1280 × 800, 1440 × 900, 2560 × 1600, 2880 × 1800 |
APP_APPLE_TV |
Apple TV | 僅搭配 displayType |
APP_APPLE_VISION_PRO |
Apple Vision Pro | 3840 × 2160 |
APP_WATCH_ULTRA |
Apple Watch Ultra | 僅搭配 displayType |
APP_WATCH_SERIES_10 |
Apple Watch Series 10 | 僅搭配 displayType |
APP_WATCH_SERIES_7 |
Apple Watch Series 7 | 僅搭配 displayType |
每個工具對輸入進行的檢查,請參閱 伺服器與登入。
結果
一個 JSON 物件,同時以文字和 structuredContent 傳回。
| 欄位 | 說明 |
|---|---|
version |
版本號碼 |
locale |
語言 |
uploaded |
每張截圖一項:displayType,接著是下列欄位 |
| 欄位 | 說明 |
|---|---|
screenshotId |
Apple 為該截圖指定的 ID,供 appstore_delete_screenshots 使用 |
fileName |
它的檔案名稱 |
size |
它的像素尺寸,例如 1320x2868,或 null |
state |
Apple 的處理狀態:AWAITING_UPLOAD、UPLOAD_COMPLETE、COMPLETE 或 FAILED |
problems |
處理失敗時,Apple 對問題的描述 |
preview |
300 × 650 PNG 預覽圖的網址,或 null |
大約一分鐘後 state 仍為 UPLOAD_COMPLETE 的截圖會照原樣回報;Apple 會稍後完成處理。FAILED 會在 problems 中附上 Apple 提供的原因。
{
"version": "1.2.0",
"locale": "en-US",
"uploaded": [
{
"displayType": "APP_IPHONE_67",
"screenshotId": "00000000-0000-0000-0000-000000000000",
"fileName": "home.png",
"size": "1320x2868",
"state": "COMPLETE",
"problems": [],
"preview": "https://example.com/preview.png"
}
]
}錯誤
每個錯誤都會以工具錯誤(isError: true)傳回。斜體 文字代表句中的實際值。所有工具都可能傳回的錯誤,請參閱 伺服器與登入。
| 訊息 | 何時出現 | 處理方式 |
|---|---|---|
| screenshots must list 1 to 10 images. | screenshots 為空或超過 10 項 |
傳送 1 到 10 項 |
| Each screenshot needs attachmentId, url, or simulator. | 某一項三者都沒有 | 為每一項指定來源 |
| Could not read attachment id. | 無法下載該附件 | 用 get_attachment 檢查 |
| Screenshot URLs must be https. | 某個 url 不是 https:// |
使用 https 網址 |
| Could not download url. | 該網址沒有回應檔案 | 檢查網址 |
| The device Simulator is not running. Start it with start_simulator. | 使用了 simulator,但團隊中該裝置的模擬器已關閉 |
用 start_simulator 啟動它 |
| The device Simulator is still starting. Call start_simulator to wait for it. | 模擬器尚未就緒 | 用 start_simulator 等待 |
| No Simulator id. Offered: ids. | simulator 指定的裝置不是 AirBuild 提供的 |
使用 list_simulators 傳回的 ID |
| Screenshot n is not a PNG or JPEG. | 圖片是其他格式 | 轉換格式 |
| Screenshot n is widthxheight, which is no App Store size. iPhone screenshots must be 1320x2868 (6.9-inch) or 1284x2778 (6.5-inch); iPad 2064x2752 (13-inch). | 像素尺寸與任何顯示尺寸都不相符,且沒有傳送 displayType |
調整圖片尺寸,或傳送 displayType |
| App Store Connect did not add locale. | Apple 沒有新增該語言 | 重試 |
| App Store Connect did not create the screenshot set. | Apple 沒有建立該尺寸的截圖組 | 重試 |
| App Store Connect did not reserve the upload. | Apple 沒有接受上傳 | 重試 |
| Apple refused the upload of file (status). Try again. | 傳送圖片給 Apple 失敗 | 重試 |
| This app has no App Store version yet. Start one with appstore_prepare_version. | 該 App 在這個平台上沒有版本 | 用 appstore_prepare_version 建立一個 |
| Pass projectId, or appId from appstore_list_apps. | projectId 和 appId 都沒有傳送 |
傳送其中一個 |
| This Project has not been built for iOS yet, so it has no bundle id to find its app by. Ask the Team’s Agent to build it, or pass appId. | 該專案從未建置過 iOS 版本 | 請專案的 Agent 建置 iOS 版本(send_message),或用 appId 指定 App |
| This Project has no app on App Store Connect yet. Create one with appstore_create_app (its bundle id is the Project’s), or pass appId. | 團隊已連結的 Apple 團隊中,沒有 App 的 bundle ID 與專案相同,或沒有連結任何 Apple 團隊 | 用 appstore_create_app 建立 App,或用 appId 指定另一個 App |
| No connected Apple team of this Team has that app. See appstore_list_apps. | appId 不是任何已連結 Apple 團隊(或 appleTeamId)中的 App |
從 appstore_list_apps 取得 ID |
| platform must be IOS, MAC_OS, TV_OS or VISION_OS. | platform 是其他值 |
傳送這四個值之一 |
| App Store Connect: Apple’s sentence | Apple 拒絕了請求。後面最多附上 Apple 自己的五句說明,Apple 指出相關欄位時會在括號中註明。App Store Connect 中有待接受的 Apple 協議時,也會以這種方式被拒絕 | 依照 Apple 的說明處理。協議由 Apple Developer 帳號的帳號持有人在 App Store Connect 中接受(商務 › 協議) |
| App Store Connect answered status. Try again in a moment. | Apple 拒絕了,但沒有說明原因 | 稍後再試 |
發生錯誤之前上傳的圖片會保留;請用 appstore_screenshots 查看。
範例
{
"name": "appstore_upload_screenshots",
"arguments": {
"teamId": "00000000-0000-0000-0000-000000000000",
"projectId": "00000000-0000-0000-0000-000000000000",
"locale": "en-US",
"screenshots": [
{
"simulator": null
},
{
"attachmentId": "00000000-0000-0000-0000-000000000000"
}
],
"replace": true
}
}