Skip to content

Latest commit

 

History

History
92 lines (65 loc) · 3.2 KB

env-setup-ios.md

File metadata and controls

92 lines (65 loc) · 3.2 KB

iOS environment setup guide

This file describes environment setup for iOS builds on macOS.

Contents

Setting up the environment

  • If your Mac uses ARM CPU (MacBook Pro M1, etc.), you have to install Rosetta: sudo softwareupdate --install-rosetta --agree-to-license
  • Install XCode via App Store.
    • You might need to enable Rosetta for XCode if you want to run the app in iOS simulator because Flutter (as of v2.5.2) does not yet support arm64 iOS simulators. Otherwise, you can get errors about missing pods (missing includes from pods).
  • Install dependencies:
    • brew install bazelisk
    • brew install protobuf
    • sudo gem install cocoapods
    • python3 -m pip install --user numpy absl-py
  • Install Flutter:
    • Download flutter repo:

      mkdir -p ~/tools && git clone --branch 3.19.6 --depth 1 https://github.com/flutter/flutter.git ~/tools/flutter
    • Add flutter binary folders to path: export PATH="$PATH:$HOME/tools/flutter/bin:$HOME/.pub-cache/bin"
      If you use zsh: echo export PATH="\$PATH:\$HOME/tools/flutter/bin:\$HOME/.pub-cache/bin" >>~/.zshrc

    • Enable protobuf plugin: dart pub global activate protoc_plugin ^21.1.2

  • Go to ios directory and install pods: pod install

Tested environment

The app was built and tested successfully in this environment:

macOS 14.4.1
Xcode 15.4

$ flutter --version
Flutter 3.19.6 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 54e66469a9 (4 weeks ago) • 2024-04-17 13:08:03 -0700
Engine • revision c4cd48e186
Tools • Dart 3.3.4 • DevTools 2.31.1

$ bazel --version
bazel 6.3.2

$ protoc --version
libprotoc 23.2

$ pod --version
1.15.2

$ python3 --version
Python 3.9.16

Note: the current version may crash with EXC_RESOURCE if built with XCode 13.0

(see issue #303)

Changing application icon

After building the application, if you would like to set a new application icon, use the following actions:

  • Go to pubspec.yaml file in root folder
  • Find flutter_icons configuration and change value of option image_path to the path of desirable application icon
  • Use flutter pub run flutter_launcher_icons:main command to set the icon

Please note that iOS icons should not have any transparency. See more guidelines here.

Formatting

To automatically format your files you must have clang-format and buildifier in addition to build dependencies.

  • brew install clang-format,
  • brew install buildifier

Install GNU utils:

  • brew install findutils
    • Add GNU utils to path: PATH="/usr/local/opt/findutils/libexec/gnubin:$PATH"
      If you use zsh: echo export PATH="/usr/local/opt/findutils/libexec/gnubin:\$PATH" >>~/.zshrc