{"success":true,"name":"mobile-app-store-release","description":"Use when publishing an app to Play/App Store.","category":".archive","path":".archive/mobile-app-store-release/SKILL.md","file":"SKILL.md","content":"---\nname: mobile-app-store-release\ndescription: Use when publishing an app to Play/App Store.\nversion: 1.1.0\nauthor: Hermes\nlicense: MIT\nmetadata:\n  hermes:\n    tags: [android, flutter, play-console, release, aab, app-store-connect, macos, subscription]\n    related_skills: [preview-pane-browser, default-stack-nextjs]\n---\n\n# Mobile app store release (build → console → review)\n\n## When to Use\nThe user says publish / release / \"make it live\" for an app on Google Play, the iOS App Store or the Mac App Store, or asks whether an app is \"ready to deliver\".\n\n## Readiness first\nAsked \"is it ready to publish?\": test before answering (run the test suite, a live end-to-end check of the product's promise on this Mac, a signed build), then answer with ONE colored table of what works, what is weak, and what the store needs. Do not claim in the store listing a promise the tests showed is not covered.\n\n## Apple App Store (Mac or iOS)\n- If App Review asks for a video link, use the `storage-brimind` skill to upload the intended MP4 to `storage.brimind.pro` and verify the returned public URL before pasting it into the review notes or reply. Check the configured uploader before asking for a manual upload or proposing Drive.\nFull API-driven sequence, endpoints and the steps only the web UI can do: `references/app-store-connect-api.md`. Gates that apply every time:\n- Give the user ALL web-UI-only steps (create app record, publish App Privacy, add the first subscription + its group to the version's draft submission, Paid Apps agreement) in one message at the start, then run everything else by API while they click. Discovering them one refusal at a time costs a round each. When the preview pane answers, do these clicks yourself (reference step 10) instead of handing them over.\n- Never let the app go to review without its subscription when a feature is paywalled: check the subscription state by API right after any submit (see step 10 of the reference).\n- A privacy policy URL and a support URL are mandatory: host them as a static Next.js export on [PRIVATE_HOST] (Caddy `root * /var/www/<name>` + `try_files {path} {path}/index.html` + `file_server`, `sudo` works for adminops), and curl each page for 200 before putting it in the listing.\n- Free app + monthly subscription is done with StoreKit 2 in the app (paywall with price, Restore Purchases, Terms (Apple standard EULA) and Privacy links; gate the paid feature on `Transaction.currentEntitlements`) plus the subscription created by API.\n- Sandboxed (Mac App Store) builds cannot start other programs or write shell profiles: hide such features behind an edition flag before review instead of shipping buttons that fail.\n- Test the archived app itself (`open -n <archive>/Products/Applications/X.app`), not only the unit tests.\n\n## Pitfall: Caddy wildcard TLS can break sibling subdomains\nAdding a broad `*.brimind.pro { tls { on_demand } ... }` catch-all block to pick up one new subdomain (e.g. `labes.brimind.pro`) broke TLS on unrelated explicit subdomains already in the same Caddyfile (api., ai., server. all failed with `TLS alert, internal error` / curl 35) — Caddy's on-demand automation policy for the wildcard interferes with automatic-HTTPS cert selection for exact-match site blocks that have no `tls` directive of their own. Never add a bare `*.brimind.pro` wildcard just to attach one domain. Instead add ONE explicit site block for that single hostname (`labes.brimind.pro { reverse_proxy [PRIVATE_HOST] }`, default automatic HTTPS, no `tls` block needed) and, on the [PRIVATE_HOST] tunnel side, list it in that tenant's `domains: [...]` in `tenants.config.json` (`npm run check` to validate) — this is safe and does not touch other sites. After any Caddyfile edit, `sudo cp` a timestamped backup first, validate with `sudo caddy validate --config ...`, reload, then curl EVERY existing subdomain (not just the new one) to confirm nothing else broke before moving on. Verify with `curl --noproxy '*'` (or `ssh` onto the [PRIVATE_HOST] and curl `127.0.0.1`) — this Mac's shell has `https_proxy` set to a local proxy ([PRIVATE_HOST]) that silently returns a fake/cached 200 for a dead site, masking a real outage. Also: if a blocked/timed-out sudo command is later followed by restoring an OLDER Caddyfile backup, re-check that the restored backup still contains every edit you need (a backup taken before a blocked command has none of its effects) — re-apply and re-verify for real content (byte size / grep for the site block), not just an HTTP status code.\n\n## Known projects\n- LuiPay (Flutter): package `pro.brimind.luipay.niger` (the name is fixed forever; it does not limit countries). Play Console account: [EMAIL], developer \"Abderrahmen Brinis\" (the same Console also holds Ali Money; its policy warnings are not LuiPay's). Source `[PATH]`. Release signing comes from `android/key.properties`, which is already set up. `[PATH]` is an old build output, not the source.\n\n- Policeman (Mac App Store, Swift + Go network extension): source `~/Documents/Unitary tools/.claude/worktrees/store-editions/police/appstore` (branch `store-editions`), bundle `pro.brimind.police.mas` + `.proxy`, team brimind 325YR3A65N. Listing, screenshots: `[PATH]`. Privacy/support site: https://policeman.brimind.pro (Next.js export in `[PATH]`, rsync to `[PRIVATE_HOST]:/var/www/policeman`, Caddy block already in place). App Store Connect: app id 6825302963, subscription group [PHONE], subscription 6825305877 (`pro.brimind.police.mas.monthly`). Live leak test without touching the installed guard: run a freshly built `police run` with `POLICE_HOME` = the App Group folder and `POLICE_NO_LAUNCH=1`, send fake secrets with curl through its proxy port using `--cacert` = system CAs + the guard's `ca.pem` concatenated (the guard's CA alone breaks every non-AI host), then read `/_police/events`. Repeat leaks within 10 min are folded into the first event, so use fresh fake values per probe.\n\n## Apple signing without Xcode login (verified)\n- App Store Connect API key of team brimind: `~/.appstoreconnect/private_keys/AuthKey_737MGX7C6X.p8`, issuer in `[PATH]` (tiny ASC API client: `asc.call(method, path, body)`). Xcode shows \"No Accounts\"; pass `-allowProvisioningUpdates -authenticationKeyPath/-authenticationKeyID/-authenticationKeyIssuerID` to xcodebuild and it registers App IDs (with Network Extensions) and profiles itself. Policeman's build.sh takes `ASC_KEY_ID`/`ASC_ISSUER` env.\n- The ASC API cannot CREATE an app record (403 \"apps does not allow CREATE\"): the user does it in the web UI; everything else except the steps listed in `references/app-store-connect-api.md` goes through the API.\n- Mac screenshots without disturbing the user: launch the app, `screencapture -x -o -l<windowID>` (window id via a CGWindowList Swift snippet), switch panes with System Events (`set selected of row N of outline 1 …`) and set the window to exactly 1280x800 (an accepted Mac size). Feed demo data from a throwaway engine with fake secrets, never the user's real log.\n\n## Google Play procedure\n1. Find the source and the current `version: X.Y.Z+N` in `pubspec.yaml`. Bump BOTH: the patch version and the build number `+N+1`. Play rejects a build number it has already seen, so always assume the current N was uploaded.\n2. Build: `flutter build appbundle --release` takes about 5 min, so run it in the background with notify. The \"Built-in Kotlin\" plugin warnings are harmless.\n3. Copy the AAB to `[PATH]<App>-<ver>+<build>.aab` and deliver it with MEDIA:.\n4. While the build runs, open `https://play.google.com/console` in the preview pane (skill preview-pane-browser) and have the user log in or switch to the account that owns the app. A signup / 2SV page = wrong Google account.\n5. In the console, in one pass: [REDACTED_KEY] → create release → upload the AAB → release notes (EN + FR). Then the store listing: write strong short and full descriptions. Then Countries/regions: add the requested set (\"all countries\" = select all available). Finally Review → send for review. Fill every text field with good final copy without asking; the user wants the best text written in.\n\n## Play Console specifics (FR UI)\n- Countries: Production → tab Pays/Régions → Modifier les pays/régions → checkbox \"Sélectionner toutes les lignes\" → Enregistrer (bottom, selector `button[debug-id='main-button']`). Verify with the track summary (\"N pays/régions\").\n- Release notes need each language tag on its own line: `<fr-FR>` newline text newline `</fr-FR>`. The same tags on one line give the error \"balise non fermée\" or \"texte en dehors des balises\". Fill it with one `type` using `\\r\\n` breaks.\n- Upload of the AAB (Importer) opens the OS file picker. The user must pick the file or drag it in; ask them to do it and say the exact path. When they say \"uploading\", poll the page (`elements full=true`) until the bundle row shows the new version, then continue without asking.\n- Submit path (verified): release page → version name auto-fills as `N (X.Y.Z)` → notes → **Suivant** → review page (\"La release est prête\", rollout already 100,0, check device counts lost = 0) → **Enregistrer** → dialog **Accéder à l'aperçu** → Publishing overview lists the changes (release + countries) with \"Vérifications rapides\" running (up to ~14 min; sleep 4 min and re-read) → when it says \"Vous pouvez maintenant envoyer vos modifications\", click **Envoyer N modifications pour examen** → confirm **Envoi des modifications pour examen**. Done when the header reads \"Modifications en cours d'examen\".\n- Country changes are not live until that same \"send for review\" step; saving them on the track only stages them.\n\n- Order inside the release page: ask the user to upload the AAB FIRST, then fill the version name and notes, then save the draft right away. Notes typed before the upload are lost on reload, and \"Suivant\" stays disabled with no new bundle.\n- Commit the version bump (`git add pubspec.yaml && git commit`) right after a successful build, so the build number is traceable.\n\n## Rejection risks to check before \"send for review\"\n- Finance or payment apps going to \"all countries\": the Financial features declaration and per-country licence rules can cause a rejection. Check Policy → App content (Financial features, Data safety, Target audience) and drop countries that need a licence the user lacks, saying which ones were dropped. Otherwise keep all.\n\n## Rules\n- Do not stop between steps to ask; run the whole console pass and pause only for real blockers (file picker, login, legal agreement).\n- Answer with a status table (green/yellow/gray), with few lines around it.\n- Never type passwords or 2SV codes. Accepting a policy declaration or signing up for a developer account is the user's decision.\n- \"Compress the chat\" is the user's `/compress` command; tell them to run it.\n","linked_files":["references/app-store-connect-api.md"],"origin":"brimind","owner_id":null,"source":"router"}