Developing and debugging Flutter apps for iOS without a Mac

Gabriel Rodríguez
Jan 10, 2019 · 6 min read
Image for post
Image for post

Get a debug build of your app running on your iOS device

Recommended: Building the app with Codemagic

Alternative: Building the app with Travis CI

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
$ gem install travis # Makes sure to have the Travis CLI installed
$ cd your_project
$ travis setup releases
deploy:
provider: releases
api_key:
secure: #your api key will be here
file: build/ios/iphoneos/app.ipa
skip_cleanup: true #important or your built app would be deleted
on:
repo: #your repo will be here
$ git add .travis.yml
$ git commit
$ git push

Installing and running the app


Preparing your machine

Install dependencies

$ pacaur -S libimobiledevice ideviceinstaller-git
$ sudo apt install libimobiledevice6 ideviceinstaller
$ sudo apt install libimobiledevice-utils libusbmuxd-tools

Modify Flutter

We’ll apply these changes to Flutter
$ cd flutter
$ git apply ios.diff
$ bin/cache/dart-sdk/bin/dart --snapshot=./bin/cache/flutter_tools.snapshot --packages=./packages/flutter_tools/.packages ./packages/flutter_tools/bin/flutter_tools.dart
bin\cache\dart-sdk\bin\dart --snapshot=.\bin\cache\flutter_tools.snapshot --packages=.\packages\flutter_tools\.packages .\packages\flutter_tools\bin\flutter_tools.dart

Preparing your project(s)

Running and debugging

Using an IDE (VS Code):

Using the command-line:

Credits


Flutter Community

Articles and Stories from the Flutter Community

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store