Android Sdk Osx

broken image


We'll be using IntelliJ IDEA Ultimate for most of our general Java development, as well as for our Android-targeted development. However, like many IDEs, IntelliJ IDEA depends on core components that we must install before we can make much use of the IDE. One of these components is the JDK; another is the Android SDK. With the latter, we'll install a number of packages that provide additional capabilities for Android development.

Note that as written, this environment preparation step assumes that the JAVA_HOME environment variable refers to the JDK 8 (aka 1.8) installation, and that the bin subdirectory of the JAVA_HOME-referenced directory is on the PATH.

I have installed Android Studio on my MacBook Air (OS Version 10.11 El Capitan) and have successfully written a small 'hello, world' app and installed on device (Nexus 7) and ran on AVD. The easiest (and standard) way to install Android SDK under OS X is to use brew. Android is an open, mobile-phone platform that is currently under development. The Android developers kit will allow you to develop Android applications that you can run, test, profile, and debug. Click on the Configure Button and select SDK Manager: In the left pane select Android SDK. On the right pane, select the SDK Platforms Tab and select the SDKs for API level 22 up to 24. Click the OK button to download and install these Android SDKs. Basically, the Android SDK is a bunch of packages necessary to develop for Android. These packages stays in subfolders of a folder called 'sdk' (or 'android-sdk' sometimes). You do not need to know.

(It's actually possible to perform or repeat this step after installing JDK 11—or any other JDK after 8—but JAVA_HOME and PATH must first be adjusted, to refer to JDK 8 instead of JDK 11. Thus, it is much simpler just to perform this step after installing JDK 8, but before installing JDK 11.)

Sdk

Important: As is almost always the case in this bootcamp, spelling and casing matter! When creating the directories specified below, please use the names and paths exactly as stated.

Videos

Download and installation

Android Sdk Tool

(For those unfamiliar with command line interfaces, it might be useful to read through Command line interfaces before performing the steps below.)

Osx Android Sdk

  1. From the Command line tools only section of the Android Studio download page, download the SDK tools package appropriate for your platform.

    Important: Depending on your browser, and a number of other factors, the above link may take you directly to the correct section of the download page—or it may not. Please make sure that you scroll to the section labeled Command line tools only, and click on the link starting with commandlinetools appropriate for your platform.

  2. Extract the contents of the downloaded file to one of the following paths, depending on your platform:

    • Windows: C:androidsdk

      Important: There is a subtle problem with the built-in Windows ZIP file support; it doesn't occur often, but it does happen with the most recent couple of versions of this specific download, and it results in the extracted contents of this downloaded file being placed in incorrect directories. We recommend using a tool such as WinZip or 7-Zip, rather than relying on the built-in ZIP features of Windows for this extraction. If you don't have any such tool installed, then you can use the unzip command included with Git Bash. To do this, open a GitBash window, and execute the following commands—which will create the C:androidsdk directory and unzip the downloaded file to that location. Note that the commands assume you've downloaded the commandlinetools-win-6609375_latest.zip file to your Downloads directory; if you've downloaded it to another location, you'll need to adjust the second line below accordingly.

      If you have an alternative ZIP management tool installed (e.g. WinZip, 7-Zip), you can create the android directory in the root of the C: drive, and the sdk directory within android, using the standard features of the Windows explorer (if you're prompted to confirm administrator access when creating the directories, or extracting the files, do so), or with the mkdir command from an elevated command prompt. After creating the C:androidsdk directory, extract the tools directory (and its contents) into C:androidsdk, using your ZIP management tool of choice.

    • OS X: /opt/android/sdk/ Ios notes to android.

      You will need use superuser access—e.g. using the sudo command—to create the directories in Terminal. You can also extract the ZIP file contents from the command line: (Note that the commands assume you've downloaded the commandlinetools-mac-6200805_latest.zip file to your Downloads directory; if you've downloaded it to another location, you'll need to adjust the second line below accordingly.)

      Alternatively, you can create the /opt/android/sdk directory from the command line, and then use the standard ZIP-management features of the Finder to extract the ZIP file contents.

    • Linux Ubuntu: /opt/android/sdk/

      You will need use superuser access—e.g. using the sudo Mario multiverse android. command—to create the directories in Terminal. You can also extract the ZIP file contents from the command line: (Note that the commands assume you've downloaded the commandlinetools-linux-6609375_latest.zip file to your Downloads directory; if you've downloaded it to another location, you'll need to adjust the second line below accordingly.)

      Alternatively, you can create the /opt/android/sdk directory from the command line, and then use the standard ZIP-management features of the Ubuntu file manager to extract the ZIP file contents.

  3. Download android-sdk-setup.zip, and extract its contents to the appropriate directory for your platform:

    • Windows: C:android.
    • OS X and Ubuntu: /opt/android/.

    When this step is complete, you will have the following overall structure:

    Windows

    • C:
      • android
        • android-sdk-setup.bat
        • android-sdk-setup-osx.sh
        • android-sdk-setup-ubuntu.sh
        • sdk
          • tools

    Linux or OS X

    • /
      • opt/
        • android/
          • android-sdk-setup.bat
          • android-sdk-setup-osx.sh
          • android-sdk-setup-ubuntu.sh
          • sdk/
            • tools/
  4. Run the extracted setup script for your platform:

    • In Windows, right-click on C:androidandroid-sdk-setup.bat in the Windows Explorer, and select Run as administrator from the context menu that appears. Alternatively, open an elevated command prompt, navigate to the C:android directory, and execute the android-sdk-setup.bat batch file.

    • In OS X, execute sudo /opt/android/android-sdk-setup-osx.sh in a terminal window.

    • In Linux Ubuntu, execute sudo /opt/android/android-sdk-setup-ubuntu.sh in a terminal window.

    Note: These scripts download and extract a large number of files. Depending on the speed of your internet connection, this step could take anywhere from 30 minutes to a few hours. Thus, we strongly recommend that you use the highest-bandwidth connection available (for example, your local Flying Star's wi-fi is definitely not up to the task).





broken image