Unity android sdk android studio

Android SDK Setup

Whether you’re building an Android application in Unity or programming it from scratch, you need to set up the Android SDK (software development kit) before you can build and run any code on your Android device.

1. Download the Android SDK

On your PC, go to the Android Developer SDK website. Download and unpack the latest Android SDK.

2. Install the Android SDK

Follow the instructions in Installing the SDK. You can skip the optional sections relating to Eclipse. In step 4 of Installing the SDK, be sure to add at least one Android platform with API level equal to or higher than 9 (Platform 2.3 or greater), the Platform Tools, and the USB drivers if you’re using Windows.

3. Enable USB debugging on your device

USB debugging is a useful way to debug while connecting your Android device to the SDK, so get this set up before moving on to the next step.

To enable USB debugging, you first need to enable Developer options. To do this, navigate your phone to the “Build number” portion in your device’s Settings. Finding it can be different depending on the device:

  • Stock Android: Settings >About phone >Build number
  • Samsung Galaxy S5: Settings >About device >Build number
  • LG G3: Settings >About phone >Software information >Build number
  • HTC One (M8): Settings >About >Software information >More >Build number

Note: On operating systems older than version 4.2 (Jelly Bean), the Developer options aren’t hidden. Go to Settings > Developer options, then enable USB debugging.

Navigate to Build number using the instructions above. Tap on the build number 7 times. A small pop-up notification appears saying “you are now X steps away from being a developer” with a number that counts down with every additional tap. On the 7th tap, Developer options are unlocked. Go to Settings > Developer options, and check the USB debugging checkbox to enable debug mode when the device is connected to a computer via USB.

4. Connect your Android device to the SDK

This can be tricky, especially under Windows-based systems where drivers tend to be a problem. Your device may come with additional information or specific drivers from the manufacturer.

  • Windows: If the Android device is automatically recognized by the system you still might need to update the drivers with the ones that came with the Android SDK. You can do this through the Windows Device Manager. If the device is not recognized automatically, use the drivers from the Android SDK, or any specific drivers provided by the manufacturer. Find further information regarding USB Drivers for Windows on the Android Developer page.
  • Mac: If you’re developing on macOS, you usually don’t need any additional drivers.

If you are unsure whether your device is properly installed on your system, please read the Android development troubleshooting page for details.

Читайте также:  Как расплачиваться телефоном вместо банковской карты сбербанк с андроид хуавей

5. Add the Android SDK path to Unity

The first time you build a project for Android (or if Unity later fails to locate the SDK), you will be asked to locate the folder where you installed the Android SDK. Select the root folder of the SDK installation. If you wish to change the location of the Android SDK, in the menu bar go to Unity > Preferences, then click External Tools.

Источник

Android SDK/NDK setup

Whether you’re building an Android application in Unity or programming it from scratch, you need to set up the Android Software Development Kit (SDK) before you can build and run any code on your Android device.

1. Download the Android SDK

Download the Android SDK from the Android Studio and SDK Tools download page. You can either use an Android Studio and SDK bundle, or only download the SDK command line tools.

2. Install the Android SDK

Install or unpack the Android SDK. After installing, open the Android SDK Manager and add at least one Android SDK Platform, the Platform Tools, the Build Tools, and the USB drivers if you’re using Windows.

3. Enable USB debugging on your device

To enable USB debugging, you need to enable Developer options. To do this, find the build number in your device’s Settings menu. The location of the build number varies between devices. The stock Android setting can be found by navigating to Settings > About phone > Build number. For different devices and Android versions, refer to your hardware manufacturer.

Build number as displayed in Android 5.0 (Lollipop) on a Samsung Galaxy Note 3

Note: On operating systems older than Android 4.2 (Jelly Bean), the Developer options aren’t hidden. Go to Settings > Developer options, then enable USB debugging.

After you have navigated to the build number using the instructions above, tap on the build number seven times. A pop-up notification saying “You are now X steps away from being a developer” appears, with “X” being a number that counts down with every additional tap. On the seventh tap, Developer options are unlocked. Go to Settings > Developer options, and check the USB debugging checkbox to enable debug mode when the device is connected to a computer via USB.

Developer options as displayed in Android 5.0 (Lollipop) — Samsung Galaxy Note 3

4. Connect your Android device to the SDK

Connect your Android device to your computer using a USB cable. If you are developing on a Windows computer, you need to install the appropriate USB driver for your device.

For more information on connecting your Android device to the SDK, refer to the Running Your App section of the Android Developer documentation.

5. Configure the Android SDK path in Unity

The first time you make a Project for Android (or if Unity later fails to locate the SDK), you will be asked to locate the folder where you installed the Android SDK. Select the root folder of your SDK installation. If you wish to change the location of the Android SDK, in the menu bar go to Unity > Preferences > External Tools.

6. Download and set up the Android NDK

If you are using the IL2CPP scripting back end for Android, you need the Android Native Development Kit (NDK). It contains the toolchains (such as compiler and linker) needed to build the necessary libraries, and finally produce the output package (APK). If you are not targeting the IL2CPP back end, you can skip this step.

Download the Android NDK version required by Unity from the NDK Downloads web page, and then extract it to a directory. The first time you build a project for Android using IL2CPP, you will be asked to locate the folder where you installed the Android NDK. Select the root folder of your NDK installation. If you wish to change the location of the Android NDK, in the Unity Editor, navigate to menu: Unity > Preferences… to display the Unity Preferences dialog box. Here, click External Tools.

Читайте также:  Почему андроид не видит вторую симку

Источник

Android SDK Setup

Whether you’re building an Android application in Unity or programming it from scratch, you need to set up the Android SDK (software development kit) before you can build and run any code on your Android device.

1. Download the Android SDK

On your PC, go to the Android Developer SDK website. Download and unpack the latest Android SDK.

2. Install the Android SDK

Follow the instructions in Installing the SDK. You can skip the optional sections relating to Eclipse. In step 4 of Installing the SDK, be sure to add at least one Android platform with API level equal to or higher than 9 (Platform 2.3 or greater), the Platform Tools, and the USB drivers if you’re using Windows.

3. Enable USB debugging on your device

USB debugging is a useful way to debug while connecting your Android device to the SDK, so get this set up before moving on to the next step.

To enable USB debugging, you first need to enable Developer options. To do this, navigate your phone to the “Build number” portion in your device’s Settings. Finding it can be different depending on the device:

  • Stock Android: Settings >About phone >Build number
  • Samsung Galaxy S5: Settings >About device >Build number
  • LG G3: Settings >About phone >Software information >Build number
  • HTC One (M8): Settings >About >Software information >More >Build number

Note: On operating systems older than version 4.2 (Jelly Bean), the Developer options aren’t hidden. Go to Settings > Developer options, then enable USB debugging.

Navigate to Build number using the instructions above. Tap on the build number 7 times. A small pop-up notification appears saying “you are now X steps away from being a developer” with a number that counts down with every additional tap. On the 7th tap, Developer options are unlocked. Go to Settings > Developer options, and check the USB debugging checkbox to enable debug mode when the device is connected to a computer via USB.

4. Connect your Android device to the SDK

This can be tricky, especially under Windows-based systems where drivers tend to be a problem. Your device may come with additional information or specific drivers from the manufacturer.

  • Windows: If the Android device is automatically recognized by the system you still might need to update the drivers with the ones that came with the Android SDK. You can do this through the Windows Device Manager. If the device is not recognized automatically, use the drivers from the Android SDK, or any specific drivers provided by the manufacturer. Find further information regarding USB Drivers for Windows on the Android Developer page.
  • Mac: If you’re developing on macOS, you usually don’t need any additional drivers.

If you are unsure whether your device is properly installed on your system, please read the Android development troubleshooting page for details.

5. Add the Android SDK path to Unity

The first time you build a project for Android (or if Unity later fails to locate the SDK), you will be asked to locate the folder where you installed the Android SDK. Select the root folder of the SDK installation. If you wish to change the location of the Android SDK, in the menu bar go to Unity > Preferences, then click External Tools.

Источник

Android SDK/NDK setup

Whether you’re building an Android application in Unity or programming it from scratch, you need to set up the Android Software Development Kit (SDK) before you can build and run any code on your Android device.

Читайте также:  Flappy bird для андроид

1. Download the Android SDK

Download the Android SDK from the Android Studio and SDK Tools download page. You can either use an Android Studio and SDK bundle, or only download the SDK command line tools.

2. Install the Android SDK

Install or unpack the Android SDK. After installing, open the Android SDK Manager and add at least one Android SDK Platform, the Platform Tools, the Build Tools, and the USB drivers if you’re using Windows.

3. Enable USB debugging on your device

To enable USB debugging, you need to enable Developer options. To do this, find the build number in your device’s Settings menu. The location of the build number varies between devices. The stock Android setting can be found by navigating to Settings > About phone > Build number. For different devices and Android versions, refer to your hardware manufacturer.

Build number as displayed in Android 5.0 (Lollipop) on a Samsung Galaxy Note 3

Note: On operating systems older than Android 4.2 (Jelly Bean), the Developer options aren’t hidden. Go to Settings > Developer options, then enable USB debugging.

After you have navigated to the build number using the instructions above, tap on the build number seven times. A pop-up notification saying “You are now X steps away from being a developer” appears, with “X” being a number that counts down with every additional tap. On the seventh tap, Developer options are unlocked. Go to Settings > Developer options, and check the USB debugging checkbox to enable debug mode when the device is connected to a computer via USB.

Developer options as displayed in Android 5.0 (Lollipop) — Samsung Galaxy Note 3

4. Connect your Android device to the SDK

Connect your Android device to your computer using a USB cable. If you are developing on a Windows computer, you need to install the appropriate USB driver for your device.

For more information on connecting your Android device to the SDK, refer to the Running Your App section of the Android Developer documentation.

5. Configure the Android SDK path in Unity

The first time you make a Project for Android (or if Unity later fails to locate the SDK), you will be asked to locate the folder where you installed the Android SDK. Select the root folder of your SDK installation. If you wish to change the location of the Android SDK, in the menu bar go to Unity > Preferences > External Tools.

6. Download and set up the Android NDK

If you are using the IL2CPP scripting back end for Android, you need the Android Native Development Kit (NDK). It contains the toolchains (such as compiler and linker) needed to build the necessary libraries, and finally produce the output package (APK). If you are not targeting the IL2CPP back end, you can skip this step.

Download the Android NDK version required by Unity from the NDK Downloads web page, and then extract it to a directory. The first time you build a project for Android using IL2CPP, you will be asked to locate the folder where you installed the Android NDK. Select the root folder of your NDK installation. If you wish to change the location of the Android NDK, in the Unity Editor, navigate to menu: Unity > Preferences… to display the Unity Preferences dialog box. Here, click External Tools.

Is something described here not working as you expect it to? It might be a Known Issue. Please check with the Issue Tracker at issuetracker.unity3d.com.

Copyright © 2017 Unity Technologies. Publication 5.5-001G 2017-03-29

Источник

Оцените статью