- Android SDK Setup
- 1. Download the Android SDK
- 2. Install the Android SDK
- 3. Enable USB debugging on your device
- 4. Connect your Android device to the SDK
- 5. Add the Android SDK path to Unity
- Настройка Android SDK
- 1. Скачать Android SDK
- 2. Установить Android SDK
- 3. Удостовериться, что система определяет ваше устройство
- 4. Добавить путь до Android SDK в Unity
- Android SDK Setup
- 1. Download the Android SDK
- 2. Installing the Android SDK
- 3. Get the device recognized by your system
- 4. Add the Android SDK path to Unity
- Android SDK Setup
- 1. Download the Android SDK
- 2. Install the Android SDK
- 3. Enable USB debugging on your device
- 4. Connect your Android device to the SDK
- 5. Add the Android SDK path to Unity
- Android environment setup
- 1. Install Android Build Support and the Android SDK & NDK tools
- 2. Enable USB debugging on your device
- Customizing the Android SDK & NDK Tools and OpenJDK installation
- Change the OpenJDK path
- Change the Android SDK Tools path
- Change the Android NDK path
- Updating the Android SDK Target API
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
Прежде чем вы сможете запустить написанный код на Android-устройстве, нужно выполнить несколько простых действий. Это относится как к работе с Unity, так и к созданию приложений с нуля.
1. Скачать Android SDK
Зайдите на страницу Android Developer SDK. Скачайте архив с последней версией Android SDK и распакуйте его.
2. Установить Android SDK
Следуйте инструкциям на странице Installing the SDK (причём, вы можете свободно пропустить опциональные части, относящиеся к Eclipse). В шаге 4 руководства Installing the SDK убедитесь, что добавили как минимум одну Android platform (Android платформу) с уровнем API равным или выше 9 (платформа 2.3 или выше), Platform Tools и USB drivers (USB драйверы), если вы используете Windows.
3. Удостовериться, что система определяет ваше устройство
Это может быть не так просто, особенно на Windows системах, в которых драйвера часто бывают источником проблем. Также, с вашим устройством может идти дополнительная информация или особые драйверы от производителя.
Для Windows: если Andoid устройство автоматически определяется системой, вам все равно придётся обновить драйверы на те, который поставляются с Android SDK. Это делается через диспетчер устройств Windows. —>Если устройство не определяется автоматически, используйте драйверы из Android SDK или особые драйверы, предоставленные производителем. —>Дополнительную информацию можно найти здесь: USB Drivers for Windows
Для Mac: если вы разрабатываете на OSX, тогда обычно не требуется никаких дополнительных драйверов.
Важно: Не забудьте включить “Отладку по USB” на вашем устройстве. Перейдите в Настройки -> Параметры разработчика , для включения отладки по USB. Начиная с Android Jelly Bean 4.2, параметры разработчика по умолчанию скрыты. Для их включения, понажимайте несколько раз пальцем на строку в меню Настройки -> Об устройстве -> Номер сборки . После этого вам станет доступен пункт Настройки -> Параметры разработчика .
Если вы не уверены, что ваше устройство корректно установилось в системе, пожалуйста, прочтите страницу Решение проблем при разработке под Android для дополнительной информации.
4. Добавить путь до Android SDK в Unity
При первой сборке проекта под Android (или если Unity не сможет обнаружить SDK), вас попросят указать местоположение папки, в которую вы установили Android SDK (вы должны выделить корневую папку установленного SDK). Путь до Android SDK также можно изменить в редакторе, выбрав в меню Unity > Preferences и перейдя в раздел External Tools окна настроек.
Источник
Android SDK Setup
There are some steps you must follow before you can build and run any code on your Android device. This is true regardless of whether you use Unity or write Android applications from scratch.
1. Download the Android SDK
Go to the Android Developer SDK webpage. Download and unpack the latest Android SDK.
2. Installing the Android SDK
Follow the instructions under Installing the SDK (although you can freely skip the optional parts 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. Get the device recognized by your system
This can be tricky, especially under Windows based systems where drivers tend to be a problem. Also, your device may come with additional information or specific drivers from the manufacturer.
For 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. This is done 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. —>Additional info can be found here: USB Drivers for Windows
For Mac: If you’re developing on Mac OSX then no additional drivers are usually required.
Note: Don’t forget to turn on “USB Debugging” on your device. Go to Settings -> Developer options , then enable USB debugging. As of Android Jelly Bean 4.2 the Developer options are hidden by default. To enable them tap on Settings -> About Phone -> Build Version multiple times. Then you will be able to access the Settings -> Developer options .
If you are unsure whether your device is properly installed on your system, please read the trouble-shooting page for details.
4. 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 (you should select the root folder of the SDK installation). The location of the Android SDK can also be changed in the editor by selecting Unity > Preferences from the menu and then clicking on External Tools in the preferences window.
Источник
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 environment setup
To build and run for Android, you must install the Unity Android Build Support platform module. You also need to install the Android Software Development Kit (SDK) and the Native Development Kit (NDK) to build and run any code on your Android device. By default, Unity installs a Java Development Kit based on OpenJDK.
Note: Unity supports Android 4.4 “KitKat” and above. See AndroidSdkVersions for details.
1. Install Android Build Support and the Android SDK & NDK tools
Use the Unity Hub to install Android Build Support and the required dependencies
See in Glossary : Android SDK & NDK tools, and OpenJDK.
Add Android modules
You can install Android Build Support, the Android SDK & NDK tools and OpenJDK when you install the Unity Editor, or add them at a later time.
For information on adding the Android modules:
If you are using a 2018 version of Unity, see the Unity 2018.4 documentation for information on manually installing these dependencies.
2. Enable USB debugging on your device
To enable USB debugging, you must enable Developer options on your device. To do this, find the build number in your device’s Settings menu. The location of the build number varies between devices; for stock Android, it’s usually Settings > About phone > Build number. For specific information on your device and Android version, refer to your hardware manufacturer.
After you navigate 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.
Note: On Android versions prior to 4.2 (Jelly Bean), the Developer options are enabled by default.
Go to Settings > Developer options (or, if this does not work, on some devices the path is Settings > System > Developer options), and check the USB debugging checkbox. Android now enters debug mode when it is connected to a computer via USB.
Connect your device to your computer using a USB cable. If you are developing on a Windows computer, you might need to install a device-specific USB driver. See the manufacturer website for your device for additional information.
The setup process differs for Windows and macOS and is explained in detail on the Android developer website. For more information on connecting your Android device to the SDK, refer to the Run Your App section of the Android Developer documentation.
Customizing the Android SDK & NDK Tools and OpenJDK installation
Unity recommends that you use the Unity Hub to install Android SDK & NDK tools, to ensure that you receive the correct versions and configuration. Unity installs Android SDK & NDK Tools and OpenJDK respectively in the SDK, NDK and OpenJDK folders under /Unity/Hub/Editor/[EditorVersion]/Editor/Data/PlaybackEngines/AndroidPlayer/.
If you have multiple versions of Unity with the same required dependencies (be sure to check System requirements for the latest) and you want to avoid duplicating the installation of Android SDK & NDK Tools and OpenJDK, you can specify a shared location in the Unity Preferences window. To do this, go to Preferences > External tools and enter the directory paths in the SDK and NDK fields:
Preferences window showing external tools settings for Android
Warning: Unity does not officially support versions of the OpenJDK, SDK, or NDK other than the ones it supplies.
To change the OpenJDK, SDK Tools, or NDK that Unity uses to build Android apps:
- Open the Project.
- Open the Preferences window (Windows and Linux: Edit >Preferences; macOS: Unity >Preferences).
- In the left navigation column, select External Tools.
Change the OpenJDK path
- Uncheck JDK Installed with Unity (recommended).
- In the JDK field, enter the path to the JDK installation folder, or use the Browse button to locate it.
Change the Android SDK Tools path
- Uncheck Android SDK Tools Installed with Unity (recommended).
- In the SDK field, enter the path to the SDK installation folder, or use the Browse button to locate it.
Unity works with the most recent version of the Android SDK available at the time of the Unity version release.
Change the Android NDK path
- Uncheck Android NDK Installed with Unity (recommended).
- In the NDK field, enter the path to the NDK installation folder, or use the Browse button to locate it.
Each version of Unity requires a specific version of the Android NDK to be installed:
Unity version | NDK version |
---|---|
2017.4 LTS | r13b |
2018.4 LTS | r16b |
2019.1 | r16b |
2019.2 | r16b |
2019.3 | r19 |
See the System requirements page for a complete list of requirements.
Updating the Android SDK Target API
Unity Hub installs the latest version of the Android SDK Target API required by Google Play.
If you need to use a more recent version, you can change the Target API from the Target API Level field in the Player Settings window (menu: Edit > Project Settings > Player, then select the Android platform). You can find the Target API Level option in the Other Settings > Identification section.
Selecting a target API for the Android SDK
After you select an option other than the default, Unity prompts you to update the Android SDK API. You can choose to either:
- Update the Android SDK
- Continue to use the highest installed version of the Android SDK
Note: If you select an older version of the Target API, the Unity Android SDK Updater will not be able to perform the update and will give you this message:
Android SDK does not include your Target SDK of (version). Please use the Android SDK Manager to install your target SDK version. Restart Unity after SDK installation for the changes to take effect.
In this case, to update the Android SDK Target API, you must use the Android sdkmanager from either Android Studio or the command line tool. Regardless of the method you chose, make sure to select the correct Android SDK folder for Unity in the Edit > Preferences > External Tools window.
On Windows, if the Unity Editor is installed in the default folder ( /Program Files/ ), you must run the sdkmanager with elevated privilege (Run as Administrator) to perform the update.
Источник