Install Android Studio
Setting up Android Studio takes just a few clicks.
First, be sure you download the latest version of Android Studio
To install Android Studio on Linux, proceed as follows:
- Unpack the .zip file you downloaded to an appropriate location for your applications, such as within /usr/local/ for your user profile, or /opt/ for shared users.
If you’re using a 64-bit version of Linux, make sure you first install the required libraries for 64-bit machines.
- To launch Android Studio, open a terminal, navigate to the android-studio/bin/ directory, and execute studio.sh.
- Select whether you want to import previous Android Studio settings or not, then click OK.
- The Android Studio Setup Wizard guides you through the rest of the setup, which includes downloading Android SDK components that are required for development.
Required libraries for 64-bit machines
If you are running a 64-bit version of Ubuntu 18.04 with the following command:
sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1 libbz2-1.0:i386
If you are running 64-bit Fedora, the command is:
sudo yum install zlib.i686 ncurses-libs.i686 bzip2-libs.i686
How to Set up your Android device
To prepare to run and test your app on an Android device, you need an Android device running at least Android 4.1 or higher.
- Enable Developer options and USB debugging on your device. Detailed instructions are available in the Android documentation.
- Windows-only: Install the Google USB Driver.
- Using a USB cable, plug your phone into your computer. If prompted on your device, authorize your computer to access your device.
- In the terminal, run the Command for language
How to Set up the Android emulator
To prepare to run and test your Flutter app on the Android emulator, follow these steps:
- First enable VM acceleration on your machine.
- Launch Android Studio, click the AVD Manager icon, and select Create Virtual Device
- In older versions of Android Studio, you should instead launch Android Studio > Tools > Android > AVD Manager and select Create Virtual Device…. (The Android submenu is only present when inside an Android project.)
- If you do not have a project open, you can choose Configure > AVD Manager and select Create Virtual Device…
- Select Next after Choose a device definition
- Select one or more system images for the Android versions you want to emulate, and select Next. An x86 or x86_64 image is recommended.
- Under Emulated Performance, select Hardware – GLES 2.0 to enable hardware acceleration.
- Verify the AVD configuration is correct, and select Finish.
For details on the above steps, see Managing AVDs.
- In Android Virtual Device Manager, click Run in the toolbar. The emulator starts up and displays the default canvas for your selected OS version and device.