You could do that with a Mac (or Hackintosh, or VM), but since we don’t have access to a macOS machine we can use one remotely via Codemagic or Travis CI — completely free! (as long as your project is on a GitHub, Bitbucket or GitLab repository).
First, create an account or sign in to codemagic.io.
Then, click the settings (gear) icon next to your app. Scroll down and click on “Build”. Make sure Mode is set to Debug, and select iOS under Build for platforms.
After that, build the app (Start your first build).
Codemagic will send you an .app file via email. Rename it so that it ends with .zip. Extract it, and you’ll get a folder called Runner.app. Create a folder called Payload and place Runner.app there. Finally , compress the folder called Payload — this will be your IPA file (you may rename it to .ipa).
Alternative: Building the app with Travis CI
You’ll need to create an account on Travis CI and let it access your GitHub account.
Then, create .travis.yml on the root of your project with the following contents:
os: osx
language: generic
before_script:
- brew update
- brew install --HEAD usbmuxd
- brew unlink usbmuxd
- brew link usbmuxd
- brew install --HEAD libimobiledevice
- brew install ideviceinstaller
- brew install ios-deploy
- git clone https://github.com/flutter/flutter.git -b beta --depth 1
script:
- flutter/bin/flutter build ios --debug --no-codesign
cache:
directories:
- $HOME/.pub-cache
before_deploy:
- pushd build/ios/iphoneos
- mkdir Payload
- cd Payload
- ln -s ../Runner.app
- cd ..
- zip -r app.ipa Payload
- popd
More info