How to build an iOS AdHoc app with flutter
Asked Answered
S

4

10

I have an flutter app for ios and can build it for the app store using:

flutter build ios --release

But how can I build an Ad-Hoc app for ios?

Sincerity answered 22/1, 2020 at 15:43 Comment(4)
Why not use xcode to archive and export as adhoc ?Barbie
Mmh, would expect the flutter tooling to do it for me. Can I do it with xcode on a ci server (so from the cli)?Sincerity
I'm using CodeMagic, I have to run it from the command line. Other command-line scripts/options would be welcome :)Glossographer
Hey @AsafPinhassi, why do you want to build an AdHoc app on Codemagic? You could build directly onto the device? If you just want to upload/store your .ipa from Codemagic - as shown in my answer - Using xcodebuild To Export a .ipa From an Archive shows the steps you can take (though it is an old article).Scarrow
S
10

Pre-requisite

  • Apple Developer Program membership ($99/year)
  • Distribution certificate added to your machine
  • In the Xcode project (Signing & Capabilities tab), select your team/ developer account which has the Apple Developer program membership.

1. Create an Archive (.xcarchive)

Technically you do not build an Ad Hoc app, you build a debug/release/profile app, which you then distribute via a distribution method, one option is Ad Hoc.

  • Using command line: You can run flutter build ipa to build the xcarchive. Then it should show a URL for your Runner.xcarchive at the output (double click that link), or
  • Using Xcode: Open the Xcode project, and in the menu bar, click Product > Archive. The organizer window will open once the archive is complete.

2. Create an .ipa

Now the Organizer window should be open. Press the Distribute App button: you should see multiple options. You can share the .ipa file with users, and they can install it onto their iPhone:

enter image description here

It's worth noting you can also create an .ipa using xcodebuild, but when you're first learning, it's nicer to use Xcode.

3. Install the .ipa on a device.

I wrote an answer about that: https://mcmap.net/q/764369/-how-to-install-an-ipa-into-an-ios-device-e-g-for-ad-hoc-distribution

enter image description here

Reminder

Just remember to do this:

Action Required: You must set a build name and number in the pubspec.yaml file version field before submitting to the App Store.

Scarrow answered 28/8, 2021 at 20:53 Comment(0)
S
13

You can use --export-method in the flutter build command, example:

flutter build ipa --release --export-method=ad-hoc

Similar answered 20/10, 2022 at 16:31 Comment(0)
S
10

Pre-requisite

  • Apple Developer Program membership ($99/year)
  • Distribution certificate added to your machine
  • In the Xcode project (Signing & Capabilities tab), select your team/ developer account which has the Apple Developer program membership.

1. Create an Archive (.xcarchive)

Technically you do not build an Ad Hoc app, you build a debug/release/profile app, which you then distribute via a distribution method, one option is Ad Hoc.

  • Using command line: You can run flutter build ipa to build the xcarchive. Then it should show a URL for your Runner.xcarchive at the output (double click that link), or
  • Using Xcode: Open the Xcode project, and in the menu bar, click Product > Archive. The organizer window will open once the archive is complete.

2. Create an .ipa

Now the Organizer window should be open. Press the Distribute App button: you should see multiple options. You can share the .ipa file with users, and they can install it onto their iPhone:

enter image description here

It's worth noting you can also create an .ipa using xcodebuild, but when you're first learning, it's nicer to use Xcode.

3. Install the .ipa on a device.

I wrote an answer about that: https://mcmap.net/q/764369/-how-to-install-an-ipa-into-an-ios-device-e-g-for-ad-hoc-distribution

enter image description here

Reminder

Just remember to do this:

Action Required: You must set a build name and number in the pubspec.yaml file version field before submitting to the App Store.

Scarrow answered 28/8, 2021 at 20:53 Comment(0)
A
0

You can use Code Magic's CLI tool to achieve that.

On their CLI (locally installed or on your CI server), there is an option to add

--type IOS_APP_ADHOC

See at the end of their signing documentation section for Specifying code signing configuration

Attach answered 1/3, 2022 at 13:45 Comment(0)
Z
-1

For Someone out there, who have trouble building ios application since they don't have an apple developer account, here's a method that i do and i use.

1st if you are an ios user you can connect your ios device into your mac and do a flutter run --release. you can also do it with just the simulator too and it does works the same.

Now, the ios app is created, using your 7 days free trial developers provisioning profile, what we need is to use some programs likie imazing,apple configurator or itunes, to get the ipa from inside the app.

Now you have build the ios app with a release version, and you can redistribute it with just a 7 days free trial version of yours.

Zimmermann answered 1/3, 2022 at 12:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.