# `mix mob.publish`
[🔗](https://github.com/genericjam/mob_dev/blob/main/lib/mix/tasks/mob.publish.ex#L1)

Uploads a release-signed artifact to the platform's app store.

    mix mob.publish --ios                       # uploads _build/mob_release/<App>.ipa
    mix mob.publish --ios path/to/Foo.ipa       # uploads a specific .ipa
    mix mob.publish --android                   # uploads android/app/build/outputs/bundle/release/app-release.aab
    mix mob.publish --android path/to/app.aab   # uploads a specific .aab
    mix mob.publish --android --track production # override track from mob.exs

Platform flag is **required** — Mob is intentionally platform-agnostic
and refuses to default to either side. Pick `--ios` or `--android`
explicitly so it's obvious from the command which store you're hitting.

## --ios prerequisites

  1. App Store Connect API key (.p8 file). Create one at
     https://appstoreconnect.apple.com/access/api with App Manager role.
  2. The app record exists in App Store Connect (the bundle ID is
     registered there as an app, not just as an App ID in the developer
     portal).
  3. `mob.exs` configured:

         config :mob_dev,
           app_store_connect: [
             key_id:    "ABC123XYZ4",
             issuer_id: "69a6de76-aaaa-bbbb-cccc-1234567890ab",
             key_path:  "~/.appstoreconnect/AuthKey_ABC123XYZ4.p8"
           ]

## What --ios does

Runs `xcrun altool --upload-app` with API-key auth. altool validates the
IPA, uploads it, and returns when Apple has accepted the build for
processing. Apple then takes 5-15 minutes to process the build before it
appears in TestFlight.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
