1.安装AndroidStudio
JDK官网
AndroidStudio官网







2.AndroidStudio设置

3.安装Android SDK(SDK PLatforms看你选哪一个,其他打钩的必选)


4.安装flutter

4.创建flutter项目

5.创建app

6.选项

7.配置开发用的Android API(选一个版本添加)


8.设置开发需要的Android API(我的是 API 28)

我这个项目是28,所以我选

9.配置android的国内镜像:阿里云镜像
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' }//有的没有这个
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
maven { url 'https://maven.aliyun.com/repository/public' }
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
//google()
//jcenter()
将上面的copy到你的项目对应位置

10.将中间的编辑线去除

11.代码块
(1)StatelessWidget
只需要输入 stless
就可以创建一个StatelessWidget。

(2)StatefulWidget
只需要输入 stful
就可以创建一个StatefulWidget。

(3)自定义代码块
AS中可以设置代码块。Settings -> Editor -> Live Templates
我们可以参考自带的slful代码块进行设置。点击👉的 + 就可添加代码块了。
12.自动格式化代码
Settings -> Editor -> Languages & Frameworks -> Flutter -> Editor
选中Format code on save 也可以勾选子选项 Organize imports on save
13.配置代理


14.ADB安装
(1)先安装Homebrew
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
(2)adb安装
brew install android-platform-tools
(3)检查当前连接的设备
adb devices
(4)生效指令
source ~/.zshrc
(5)重启终端和AndroidStudio



14.完全卸载AndroidStudio
第一步: 卸载Android Studio应用及相关配置
在终端中输入:
rm -Rf /Applications/Android\ Studio.app
rm -Rf ~/Library/Preferences/AndroidStudio*
rm -Rf ~/Library/Preferences/com.google.android.studio.plist
rm -Rf ~/Library/Application\ Support/AndroidStudio*
rm -Rf ~/Library/Logs/AndroidStudio*
rm -Rf ~/Library/Caches/AndroidStudio*
第二步:删除所有Projects
rm -Rf ~/AndroidStudioProjects
第三步:删除gradle相关文件
rm -Rf ~/.gradle
第四步:卸载所有Android Virtual Devices(AVDs) and *.keystore. note:
rm -Rf ~/.android
第五步:删除Android SDK tools,对应自己的sdk目录即可
rm -Rf ~/Library/Android*
网友评论