Use the ubuntu system for car development, start configuring the environment today, first download android studio, and then download the android sdk, here it should be noted that the linux system cannot use the Android sdk under the windows system, and there will be various problems in the personal test.
The general idea is to download the sdk and modify the environment after installation. Open the official website and there are no download resources for the various versions of the sdk
Now you can download the sdk by downloading the sdkmanager toolkit
1. Open the official website of android studio and slide to the bottom
Download Android Studio & App Tools - Android Developers (google.cn)
2. Download the sdk of the linux system and decompress it
unzip commandlinetools-linux-7583922_latest.zip
3、进入sdkmanager所在目录,sdkmanager
In the zip package decompressed above, /home/android-sdk/cmdline-tools/bin
click .
Choose to download the latest sdk version
4. Use the command to view the latest stable version
[root@192 bin]# ./sdkmanager --list --channel=0
Error: Could not determine SDK root.
Error: Either specify it explicitly with --sdk_root= or move this package into its expected location: <sdk>/cmdline-tools/latest/
An error was reported, and the sdk root directory could not be found. There are two solutions: one is to use –sdk_root to specify the path, and the other is to move the folder to the specified path.
[root@192 cmdline-tools]# mkdir latest
[root@192 cmdline-tools]# mv bin/ lib/ NOTICE.txt source.properties -t latest/
Execute the query command again, and a long version will be found.
[root@192 cmdline-tools]# cd latest/bin/
[root@192 bin]# ./sdkmanager --list --channel=0
5. Install sdk
Because the App project uses the Android-30 version, install the corresponding platforms; android-30
./sdkmanager "build-tools;30.0.3" "platforms;android-30"
Choose when the agreement license pops up y
, and the installation will begin.
After the download is complete, you can cmdline-tools
find the downloaded sdk in the same level directory as . This is why it is specified above sdk-root
.
[root@192 android-sdk]# ls
build-tools cmdline-tools commandlinetools-linux-7583922_latest.zip emulator licenses patcher platforms platform-tools tools
6. Configure the ANDROID_HOME environment variable
[root@192 android-sdk]# export ANDROID_HOME=/home/android-sdk
[root@192 android-sdk]# export PATH=$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin:$PATH
[root@192 android-sdk]# source /etc/profile
Linux installation of Android Sdk completed
Note: If the Linux system does not allow access to the external network, you need to surf the Internet scientifically, or import it into Linux after successfully downloading from other computers