Download the latest installer from the Flutter SDK version list or just git clone
.
|
|
Add the path to the downloaded and unpacked file to the environment variable. For example, on Linux and macOS Mojave and earlier systems, Bash Terminal is used by default, so you need to modify the $HOME/.bashrc
file, while macOS Catalina systems use Z Shell
by default, so you need to modify the $HOME/.zshrc
file.
Run source $HOME/.bash_profile
to refresh the current terminal to take effect.
Verify that the flutter command is available.
|
|
Check if the current environment requires additional dependencies to be installed.
|
|
Setting up the iOS development environment
Make sure Xcode is installed.
Create a new Flutter App
|
|
Two ways to open a project.
-
Use
Android Studio
to openOpen
Preferences
>Plugins
inAndroid Studio
and search forFlutter
andDart
plugins to install. Use Android Studio >Open an existing Android Studio project
to open theeaseapi_app
directory, you can directly select the iOS simulator to run. -
Open with
Xcode
Open the
ios/Runner.xcworkspace
project directly viaXcode
.
Set package name and developer Team for iOS project
flutter provides commands to automate the build.
|
|
You need to configure the package name and developer team of the project before using it.
Open the project via Xcode: TARGETS > Signing & Capabilities
.
Add Podfile for the newly created Flutter App
Execute: pod install
, and an error will occur.
|
|
This is because flutter
and Cocoapods
both generate xcconfig
files for the corresponding PROJECT, flutter
has already generated xcconfig
, and executing pod install
will prompt that the file already exists. At this point, the xcconfig
configuration for Cocoapods
is not in effect.
You can manually introduce the xcconfig
file generated by pod install
into the xcconfig
file generated by flutter
. The procedure is as follows.
Once the above configuration is complete, run Runner.xcworkspace
directly with Xcode.