react-native--on Mac configuration react native Android development environment Drainage PIT summary

Source: Internet
Author: User
Tags touch command android sdk manager

Configure React Native Android Development Environment Summary 1, uninstall Android Studio, execute the following command on the terminal (terminal):
    1. Rm-rf/applications/android\ Studio.app
    2. RM-RF ~/library/preferences/androidstudio*
    3. RM ~/library/preferences/com.google.android.studio.plist
    4. RM-RF ~/library/application\ support/androidstudio*
    5. RM-RF ~/library/logs/androidstudio*
    6. RM-RF ~/library/caches/androidstudio*
2. Delete Projects
    1. RM-RF ~/androidstudioprojects
3. Delete Gradle
    1. RM-RF ~/.gradle
4. Uninstall Android Virtual Devices (AVDs) and *.keystore. Note: If other ides are needed, do not remove
    1. RM-RF ~/.android
5. Remove the Android SDK Tools Note: Do not delete if other Ides are needed

RM-RF ~/library/android*

6. when installing Android studio for the first time pop-up unable to access Android SDK add-on list because your PC does not have an SDK and you download Android studio without SDK;

As shown:

Workaround: Found in the directory you installed: Bin\idea.properties Open this file to add a line at the end of Disable.android.first.run=true, if you can't open this file, You can download the installation EditPlus tool or the Sublime_text tool, open the modification with the tool, if it is too troublesome, it is easy to open with txt. Environment construction

The Android app is developed in the Java language

  • Download the JDK (Java development package),
  • Install JDK when download is complete
  • To configure a Java environment variable:
    • On the command line, enter
          $ /usr/libexec/java_home
      To locate the Java installation path in your Mac
    • On the command line, enter:
           $ touch ~/.bash_profile
      (The Touch command is to create the file if it does not exist)
    • On the command line, enter:
           open ~/.bash_profile
      (Open the file with an editor)
    • Take the first step to the Java installation path assigned to Java_home, and copy the following into the. bash_profile file
      export JAVA_HOME=查找到的java安装路径export PATH=$JAVA_HOME/bin:$PATHexport CLASS_PATH=$JAVA_HOME/lib:$CLASS_PATH
    • On the command line, enter:
      source ~/.bash_profile
      (Source command is execute file)
    • Verify that the environment variable is successful: Enter at the command line:
        $ java 或  $javac
      (if the command cannot be found to indicate a failure) or input
         echo $JAVA_HOME
      (whether the Java installation path can be printed successfully)
Android Development Environment Building

Android Studio installation
Android Studio is the official Ide,android studio that developed Android, and I downloaded the integration (Android SDK) version, which was installed after download.

Android SDK Download
The Android SDK is a development kit developed for Android.
Open Android Studio,


Android.png

Click on the button below to access the Android SDK Manager interface


Android Manager.png

Download the following resources:

    • Android SDK build-tools Version 23.0.1
    • Android 6.0 (API 23)
    • Android Support Repository

Paste_image.png
Paste_image.png

Android SDK environment variable settings

    • Refer to Setting the Java environment variable to open the. Bash_profile steps
    • Open Android Studio and click SDK Manager in the menu bar

      SDK Manager icon
      You can view the installation path for the Android SDK
    • Assign the installation path of the SDK found in the previous step to Android_home, and copy the following to the. bash_profile

      export ANDROID_HOME=查找到到sdk路径export PATH=${PATH}:${ANDROID_HOME}/tools  export PATH=${PATH}:${ANDROID_HOME}/platform-tools
    • On the command line, enter:

       $source ~/.bash_profile
    • On the command line, enter:
      $ adb
      (Verify that the Android SDK environment variable is set successfully)

react-native--on Mac configuration react native Android development environment Drainage PIT summary

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.