This is the second day of my participation in Gwen Challenge

Note: This article is republished from the personal public number (Island front island)

Flutter is Google’s mobile UI framework for quickly building high quality native user interfaces and applications for mobile (iOS & Android), Web, desktop, and embedded devices from a single code base.


Why leave the Android Studio Ide?

Why did I want to write Flutter without Android Studio Ide?

This is because, by the time all the required environments and SDK for the Android Studio Ide are installed, it takes up about 6-8GB of disk space. This is too much for me! Afraid of! Some! ! So I started to try to develop Flutter without the Android Studio Ide and only use VS Code. Fortunately, Flutter officially supports VS Code. For details, see flutterChina.club

To find out if I could install the required environment without the Android Studio Ide, I chose an Android Studio Ide

ASI Official download: Android-studio-IDE-windows.exe

During the installation process, I recorded some important installation execution commands

Finally, I put this information together and found that you only need two tools that support the environment to develop without the Android Studio Ide. You can also download the decompression package from the ASI official website

The required package

  • SDK tools
  • platform-tools

First, unpack the SDK Tools into the folder \Android SDK that you specify

Then unpack platform-tools into the folder \Android SDK you specified

\Android SDK ├─ tools ├─ platform-toolsCopy the code

Environment Variable Configuration

Then you need to set the system environment variable:

ANDROID_HOME=" your folder \Android SDK" PATH=" your folder \Android SDK\tools" PATH=" your folder \Android SDK\tools\bin" PATH=" your folder \Android SDK\tools\bin" PATH=" Your folder \Android SDK\platform-tools"Copy the code

After the configuration is complete, you can use android-related commands. Open the command line -> enter Android

android
Copy the code



(Android command)

The SDK manager

Open the command line -> enter sdkManager –list

This is the MANAGER of the SDK (note that sdkManager relies heavily on JDK 1.8.0 and will report an error if it is too high or too low)

sdkmanager --list
Copy the code

At this point, you will find that all versions of the SDK and API supported by Android Studio are available

But if you want to use sdkManager to manage these things sorry! Still no!



(SDK manager)

The lack of repositories. CFG

You need to find C:\Users\XXX\.android\

Then create a file called repositories.cfg



(Create repositories.cfg file)

Then on the command line -> enter sdkManager “platforms; android-29”

#Android-29 is an Android versionsdkmanager "platforms; android-29"Copy the code

Once the transfer is complete, you’re ready to use the basic (non-emulator) Android development environment.

You can also update it if you like:

sdkmanager --update
Copy the code
android update sdk
Copy the code

Next, just connect to the phone and open the developer mode to start development

It identifies the phone I’m using as MI 5 – MI 5

Then execute the command flutter run

flutter run
Copy the code



(flutter deome)


The last

  • If you only want a development environment that can be connected to a real machine, then this article is for you. Because all the tools here are fully installed using only 336Mb of space.
  • However, if you want to develop in an Android virtual machine environment, follow the official instructions and use the Android Studio Ide.
  • Of course, you want to be a bit more Geeks, and it’s also possible to create an Android virtual machine development environment using the command line.