Install Android SDK on Mac and configure environment variables

1. Download Android SDK for Mac

If you can jump over the wall, of course, Google is the first choice.

For those who cannot overturn the wall, the following two URLs are recommended:

a). http://down.tech.sina.com.cn/page/45703.html

b). http://mac.softpedia.com/get/Developer-Tools/Google-Android-SDK.shtml

Of course, it is also recommended that you get a VPN. After all, if you are a programmer, Google search is recommended.

After downloading the SDK, extract it to a certain directory. For example /Users/test/work

Second, set the download proxy server

Enter the tools directory from the command line and enter ./androidsdk to pop up the Android SDK Manager interface.

The upper left corner of the Manager interface Android SDK Manager -> Preferences...

Note the red line in the picture above.

http proxy server fill in here:  mirrors.neusoft.edu.cn

Fill in 80 for the port, and then check the box before Forcehttps://

3. Tools menu at the top of Mac

Select ManageAdd-on Site


http://mirrors.neusoft.edu.cn/android/repository/addon-6.xml
http://mirrors.neusoft.edu.cn/android/repository/addon.xml  
http://mirrors.neusoft.edu.cn/android/repository/extras/intel/addon.xml  
http://mirrors.neusoft.edu.cn/android/repository/sys-img/android-tv/sys-img.xml  
http://mirrors.neusoft.edu.cn/android/repository/sys-img/android-wear/sys-img.xml  
http://mirrors.neusoft.edu.cn/android/repository/sys-img/android/sys-img.xml  
http://mirrors.neusoft.edu.cn/android/repository/sys-img/google_apis/sys-img.xml  
http://mirrors.neusoft.edu.cn/android/repository/sys-img/x86/addon-x86.xml  
http://mirrors.neusoft.edu.cn/android/repository/addons_list-2.xml  
http://mirrors.neusoft.edu.cn/android/repository/repository-10.xml

Put all the above URLs into new, and then download.

Note : The circled items in the above picture are recommended to be checked, otherwise the Android simulation device may not be created

Fourth, configure environment variables

1. Open Terminal, enter cd ~/ to enter the user's home directory

2. Enter touch .bash_profile to create a profile

3. Enter open .bash_profile to edit the file

4. Write the following content in the file

export ANDROID_HOME=/Users/test/work/android-sdk-macosx

export PATH=${PATH}:${ANDROID_HOME}/tools

exportPATH=${PATH}:${ANDROID_HOME}/platform-tools

       Note that the first path is changed to your own sdk path

5. Save the file and execute source .bash_profile

6. Verification: Enter adb and press Enter. If the command not found is not displayed, it means that the command is valid, and the environment setting is completed.

 


    



Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324602240&siteId=291194637