Skip to content

Commit

Permalink
Tip 209
Browse files Browse the repository at this point in the history
  • Loading branch information
bizz84 committed Nov 26, 2024
1 parent 50026ec commit beb6b44
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ This repo now has a companion app! [Download it here](https://fluttertips.dev/)
| ID | View on GitHub (this repo) | X Post | LinkedIn Post | Bluesky Post | Link on [codewithandrea.com](https://codewithandrea.com/) |
| -- |-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| ------ | ------------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------ |
| 209 | [iOS App Store: Build and Upload Script](tips/0209-build-upload-ios-script/index.md) | [link](https://x.com/biz84/status/1861074917917073843) | [link](https://www.linkedin.com/posts/andreabizzotto_when-building-mobile-or-web-apps-security-activity-7266842729458851840-JuGi) | [link](https://bsky.app/profile/codewithandrea.com/post/3lbrv7hm3mk2v) | |
| 208 | [API keys storage: Client or Server?](tips/0208-api-keys-client-server/index.md) | [link](https://x.com/biz84/status/1861074917917073843) | [link](https://www.linkedin.com/posts/andreabizzotto_when-building-mobile-or-web-apps-security-activity-7266842729458851840-JuGi) | [link](https://bsky.app/profile/codewithandrea.com/post/3lbrv7hm3mk2v) | |
| 207 | [Downloads Count on pub.dev](tips/0207-downloads-count-pub-dev/index.md) | [link](https://x.com/biz84/status/1859569027045089661) | [link](https://www.linkedin.com/posts/andreabizzotto_did-you-know-you-can-now-see-the-downloads-activity-7265335006363889664-yKdp) | [link](https://bsky.app/profile/codewithandrea.com/post/3lbhgjp42zs2q) | |
| 206 | [Script to Update the Android Project Settings](tips/0206-update-android-project/index.md) | [link](https://x.com/biz84/status/1858451367959855404) | [link](https://www.linkedin.com/posts/andreabizzotto_tired-of-dealing-with-gradle-and-other-build-activity-7264217587473911808-skOn) | [link](https://bsky.app/profile/codewithandrea.com/post/3lb7ohh4coc2k) | |
Expand Down
2 changes: 1 addition & 1 deletion tips/0208-api-keys-client-server/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ If you work with Firebase Cloud Functions and want to learn about best practices

| Previous | Next |
| -------- | ---- |
| [Downloads Count on pub.dev](../0207-downloads-count-pub-dev/index.md) | |
| [Downloads Count on pub.dev](../0207-downloads-count-pub-dev/index.md) | [iOS App Store: Build and Upload Script](../0209-build-upload-ios-script/index.md) |


<!-- TWITTER|https://x.com/biz84/status/1861074917917073843 -->
Expand Down
Binary file added tips/0209-build-upload-ios-script/209.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
81 changes: 81 additions & 0 deletions tips/0209-build-upload-ios-script/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# iOS App Store: Build and Upload Script

Did you know?

With this simple script, you can build and upload your iOS app to App Store Connect.

The best thing? You can run it from your local machine (no CI/CD needed!)

Read below for instructions on how to get it working. 🧵

![](209.png)

<!--
# Exit immediately if any command fails
set -e
# Validate that the API Key ID and Issuer ID are set
if [[ -z ${APP_STORE_CONNECT_KEY_ID} ]]; then
echo "Please set APP_STORE_CONNECT_KEY_ID as an environment variable."
exit 1
fi
if [[ -z ${APP_STORE_CONNECT_ISSUER_ID} ]]; then
echo "Please set APP_STORE_CONNECT_ISSUER_ID as an environment variable."
exit 1
fi
# Start from a clean slate
# This ensures that there's only one *.ipa inside build/ios/ipa when uploading with xcrun
flutter clean
flutter pub get
# Build the IPA file using Flutter
echo "Building the IPA..."
flutter build ipa # TODO: add your app-specific build arguments here
# Upload the IPA file to App Store Connect using xcrun
echo "Uploading the IPA to App Store Connect..."
xcrun altool --upload-app --type ios --file build/ios/ipa/*.ipa \
--apiKey ${APP_STORE_CONNECT_KEY_ID} --apiIssuer ${APP_STORE_CONNECT_ISSUER_ID}
-->

---

The script uses the xcrun command line tool to upload the IPA to App Store Connect.

You’ll need to authenticate with one of these methods:

- Username and Password
- App Store Connect API Key (recommended)

This guide explains how to obtain an API key:

- [Creating API Keys for App Store Connect API](https://developer.apple.com/documentation/appstoreconnectapi/creating-api-keys-for-app-store-connect-api)

---
Once you have obtained your Key ID and Issuer ID, set them as environment variables in your system (I like to store mine in ~/.zshrc for convenience.)

Then, simply download the script and use it. 👍

- [Simple script to build and upload the IPA file to App Store Connect](https://gist.github.com/bizz84/0a00a48dce7982cf3b3cc59c940ee344)

---

My latest course, Flutter in Production, covers the entire iOS app release process in detail—from joining the Apple Developer Program to submitting your app for review.

Here’s a free lesson to get started:

- [Intro: Releasing Your iOS App to the App Store](https://pro.codewithandrea.com/flutter-in-production/09-release-ios/01-intro)

---

| Previous | Next |
| -------- | ---- |
| [API keys storage: Client or Server?](../0208-api-keys-client-server/index.md) | |

---

<!-- TWITTER|https://x.com/biz84/status/1861378082013073495 -->
<!-- LINKEDIN|https://www.linkedin.com/posts/andreabizzotto_did-you-know-with-this-simple-script-you-activity-7267144848770490368-KboJ -->
<!-- BLUESKY|https://bsky.app/profile/codewithandrea.com/post/3lbty7cjgdk2v -->

0 comments on commit beb6b44

Please sign in to comment.