Three small scripts I wrote while moving two unreleased apps from one Apple developer account to another. They exist because the store tooling can report success without having changed anything, so it is worth reading the store state back rather than trusting an exit code.
Write-up: https://janpreet.com/moving-apps-between-apple-accounts
Stdlib only (openssl, net/http, json, base64), so they run on a stock
macOS Ruby with no Gemfile and no bundle exec.
Create an App Store Connect API key under Users and Access > Integrations >
App Store Connect API with the App Manager role, and download the .p8
(you get exactly one download). Then:
export ASC_KEY_ID=ABCD123456 # 10-char key id
export ASC_ISSUER_ID=00000000-0000-0000-0000-000000000000 # differs per account
export ASC_KEY_P8=~/keys/AuthKey_ABCD123456.p8
# or, instead of the path, the same base64 blob you'd put in a CI secret:
# export ASC_KEY_CONTENT=$(base64 -i AuthKey_ABCD123456.p8 | tr -d '\n')Credentials are only ever read from the environment.
Which account are these credentials actually for? Run this before debugging anything else.
$ ruby asc_whoami.rb
2 app(s) visible to these credentials:
My First App com.example.firstapp id=1234567890
My Second App com.example.secondapp id=1234567891
After moving apps between accounts, a tool that "cannot find" an app has usually authenticated perfectly, as the wrong identity. Seeing the app list is faster than reading the failure.
Works around fastlane#20538:
the first deliver against a brand new app record dies with [!] No data,
because the version's review detail does not exist yet and Apple returns an
empty payload instead of an empty object.
Creating the review detail once per version fixes it permanently. It is also just faster than typing the same four fields into four version pages.
REVIEW_FIRST_NAME="Jane" REVIEW_LAST_NAME="Doe" \
REVIEW_PHONE="+1 5550100" REVIEW_EMAIL="review@example.com" \
ruby asc_seed_review_details.rb com.example.firstappPass --dry-run to list the versions it would touch. With no bundle ids it
does every app the credentials can see. Creates or updates in place, so it is
safe to re-run.
Reads back the fields a store deploy claims to have set: age rating, Kids Category age band, the privacy policy URL per locale, and builds per platform.
$ ruby asc_verify_store_state.rb
My First App (com.example.firstapp)
state=PREPARE_FOR_SUBMISSION ageRating="FOUR_PLUS"
age rating non-defaults: {"kidsAgeBand"=>"FIVE_AND_UNDER"}
en-US: privacyPolicyUrl="https://example.com/privacy/"
IOS 1.0.0 build 1: VALID uploaded 2026-01-01T00:00:00-08:00
TV_OS 1.0 build 2: VALID uploaded 2026-01-01T00:00:00-08:00
An empty privacy URL is flagged with <-- EMPTY, and the age rating line shows
only the values that are not at their harmless default, so the answers that
matter do not scroll past in a wall of NONE.
This script is the reason I caught two problems: a lane that printed "applied privacy URL" while silently skipping it, and a Kids age band that was set correctly and then quietly cleared by a later run of the same lane. Both looked like success from the outside.