Chapters

Hide chapters

Flutter Apprentice

Fourth Edition · Flutter 3.16.9 · Dart 3.2.6 · Android Studio 2023.1.1

Section II: Everything’s a Widget

Section 2: 5 chapters
Show chapters Hide chapters

Section IV: Networking, Persistence & State

Section 4: 6 chapters
Show chapters Hide chapters

21. Build & Release an iOS App
Written by Stef Patterson

Heads up... You're reading this book for free, with parts of this chapter shown beyond this point as scrambled text.

In this chapter, you’ll learn how to use Xcode and TestFlight to distribute your Flutter app’s iOS version.

Unlike with Android, apps can’t be sideloaded onto iOS devices. To distribute your app to users and testers, you have to go through App Store Connect, Apple’s developer portal for the App Store. TestFlight allows you to send apps to testers and gather feedback from both your internal team and the outside world.

For this chapter, you’ll need to use a Mac with Xcode installed. You’ll also need a valid Apple Developer Program account to access the App Store.

If you’re following along with your app, open it and keep using it with this chapter. If not, locate the projects folder for this chapter and open the starter folder.

Note: If you use the starter app add your apiKey in lib/network/spoonacular_service.dart because your app needs to work correctly to submit it to the store.

Run flutter pub get and then run your app on an iOS simulator to set up the necessary files in the iOS folder.

Creating the Signing

It’s time to leave Android Studio (or VS Code) and move over to Xcode. Open starter/ios/Runner.xcworkspace. This workspace includes the main app projects and the CocoaPods dependencies you need to build the app. It’s the same workspace you used when adding your iOS app icons a couple of chapters ago.

In the Project navigator, check if there’s a folder arrow next to Pods and has a blue icon next to it as shown below.

If not, close the Xcode project, return to Android Studio and run your app on an iOS simulator. This will pull all the required files. When you’re done, re-open starter/ios/Runner.xcworkspace.

Select Runner in the Project navigator to open the project editor. Select the Runner target and open the General tab.

For app submission, it’s important to check the Bundle Identifier. This has to be unique for your app.

If you want to follow along with this tutorial to test out the process — that is, not submit — you still have to change the existing value. Try using a random unique string if you are out of ideas.

Next you’ll learn about joining the Apple Developer Program. If you already have a valid Apple Developer Program account, move on to the following section: Creating an App Identifier.

Creating an Apple Developer Program Account

If you want to enroll in the Apple Developer Program, open https://developer.apple.com/account and sign in with your Apple ID. If you see a page prompting you to join the Apple Developer Program, you need to click the link and follow the instructions to enroll.

Creating an App Identifier

In the developer portal, you’ll tell Apple about your app.

Setting the Team

In Xcode, click the Signing & Capabilities tab. This will allow you to select a team. Select your developer team in the drop-down. If you aren’t signed in through Xcode, choose Add an Account… to sign in.

Setting up the App Store

When you submit an Android app, you first have to have a Google Play developer account and then set up the app in the Play Store. For iOS (and macOS) apps, you need to follow the same procedure for Apple.

Creating a New App

Before you can upload and distribute a build, you first have to create a record for the app by adding some basic information.

Uploading to the App Store

On Android, you made an appbundle to distribute to the Play Store. iOS has a parallel concept. You’ll need to build an archive to upload to the App Store. You can do this from either Xcode or the command line. For this chapter, you’ll use Xcode.

Uploading the Build

From the organizer window, click Distribute App.

Sharing Builds Through TestFlight

Now, you’re ready to test your build. There are two options for test builds: Internal Testing and External Testing.

Export Compliance

You might see an Export Compliance warning. If so, follow the instructions at the link to address it.

Internal Testing

You can begin internal testing as soon as the app finishes processing and you’ve addressed any outstanding issues.

External Testing

Internal testing is limited to a few people who are in your store account. Obviously, you don’t want to give store access to testers who aren’t part of your organization.

Submitting Your App to the App Store

To submit your app to the App Store for download or purchase, you need to add all the information required under the App Store tab, such as screenshots, marketing, privacy policy and age rating.

Key Points

  • You have to configure the Apple Developer Portal and App Store Connect before you can upload a build.
  • Use Xcode to archive the project to easily upload your app to the App Store.
  • Use TestFlight for internal and external testing of iOS apps.

Where to Go From Here?

If you want to take this to the next level and learn more about app signing or distributing and selling to customers in the App Store, then iOS App Distribution & Best Practices https://www.kodeco.com/books/ios-app-distribution-best-practices is for you.

Have a technical question? Want to report a bug? You can ask questions and report bugs to the book authors in our official book forum here.
© 2024 Kodeco Inc.

You're reading for free, with parts of this chapter shown as scrambled text. Unlock this book, and our entire catalogue of books and videos, with a Kodeco Personal Plan.

Unlock now