1. Download flutter SDK

Dev /docs/develo…

Git clone -b beta github.com/flutter/flu…

2. Configure the flutter environment variables

open -e ~/.bash_profile

export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn 
exportPATH= just downloaded outer PATH of the flutter folder /flutter/bin:$PATH 
Copy the code

3, check the environment and what problems

flutter doctor 
Copy the code

Continue to configure the environment as prompted

4. Android Studio related environment configuration

1, install,

The official address: developer.android.com/intl/zh-cn/…

Can’t access and the two spare ~ : developer. The android, Google. Cn/studio, www.android-studio.org/

2. Configure the Android Studio environment variables

export ANDROID_HOME="/Users/zhangjianing/Library/Android/sdk"
Copy the code

3. Enter The Studio and install dart and Flutter

5. Resolve remaining flutter Doctor issues

1, agree to several agreements, execute the following command, all the way yes

flutter doctor --android-licenses
Copy the code

Install vscode for Flutter extension

3. Other XCODE, IOS tool, etc., can be installed if you want

6. Start debugging

1. Create a Flutter project first

flutter create xxxxx
Copy the code

2. Real machine debugging/simulator

Click Create Virtual Device in the Android Studio toolbar to Create, and it is expected to download something with more than one GIGAByte. Unfortunately, this MacBook does not have an expansion dock, so it cannot be debugged. So it’s only a temporary emulator, and so far it’s taken over 15 GIGABytes (still without IOS Tools and XCODE)

3. Compile and debug

Install an app to the simulator/real machine to preview the flutter run.

4, if flutter run stuck, general is to agent, not the agent, you can change the flutter SDK, Path/packages/flutter_tools/gradle/flutter gradle this file, use YunYuan ali

buildscript {
    repositories {
        // google()
        // jcenter()
        maven { 
            url'https://maven.aliyun.com/repository/google' 
        }
        maven{
            url 'https://maven.aliyun.com/repository/jcenter'
        }
        maven{
            url 'http://maven.aliyun.com/nexus/content/groups/public'
        }
    }
    dependencies {
        classpath 'com. Android. Tools. Build: gradle: 3.3.2 rainfall distribution on 10-12'}}Copy the code

5. Now you can debug happily