ref –
- https://trevorsullivan.net/wp-content/uploads/2015/11/Trevor-Sullivan-VI-Shortcuts.pdf
- https://stackoverflow.com/questions/58387606/flutter-app-running-error-dart-can-not-be-opened-developer-can-not-be-verified
Download flutter and unzip it into say, your home directory /Users/username.
Still in your home directory, type:
ls -la
You should see a whole list of files.
Look for a .zshenv or a .zshrc file:
-rw-r–r– 1 rtsao staff 91 Mar 23 16:10 .zshenv
If it doesn’t exist, just create one:
touch .zshenv
If you do have it just edit it:
vi .zshenv
Then in that file, put flutter’s bin directory in PATH:
1 |
export PATH=$PATH:/Users/rtsao/software/flutter/bin |
then type:
flutter doctor
and follow the flutter URLs to download the needed packages:
- Install xCode
- Install Android
As flutter is downloading and executing, sometimes you’ll need to allow security to let it run:
Go to System Preferences > Security and click ‘Open Anyways’ for some of the packages that is trying to install.
There is a special situation where gen_snapshot will repeatedly get denied because the system can’t verify the developer.
You can allow your mac/apps downloaded from anywhere with this command:
sudo spctl –master-disable
As you download apps and allow access to installations, eventually everything will be a success:
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.0.3, on macOS 11.1 20C69 darwin-x64, locale en-CN)
[✓] Android toolchain – develop for Android devices (Android SDK version 30.0.3)
[✓] Xcode – develop for iOS and macOS
[✓] Chrome – develop for the web
[✓] Android Studio (version 4.1)
[✓] IntelliJ IDEA Community Edition (version 2020.3.2)
[✓] VS Code (version 1.54.2)
[✓] Connected device (1 available)
• No issues found!