- Setting Up Your Android Device For Development
- Going over how to set your Android devices up for UE4 development.
- 1. Installing Android USB Drivers to Your Computer
- 2. Enabling Developer Mode on Your Android Device
- 3. Enabling USB Debugging
- 4. Verifying That Your Device is Connected
- End Result
- Setting Up Android SDK and NDK for Unreal
- How to set up your Android development environment for Unreal 4.25 and later
- Recommended Setup
- 1. Installing Android Studio
- 2. Setting Up Android Studio for First-Time Use
- Finalizing Android Studio Installation on Your OS
- 3. Setting Up Android NDK
- Manually Targeting SDK Paths
- Android SDK and NDK Compatibility
Setting Up Your Android Device For Development
Going over how to set your Android devices up for UE4 development.
In the following section we will go over all you need to know to set up your Android device so that it can be used to run your Unreal Engine project.
1. Installing Android USB Drivers to Your Computer
Connect your Android device to your development PC via USB.
Your device driver software should automatically install. If not, visit Android’s OEM USB Drivers page to find more driver installation links and additional information.
Disconnect your Android device from USB and then immediately plug it back in. After the device is recognized by the PC, the following message will appear on your Android device asking you if you want to allow this PC to talk to your device. A message box will ask what you want the USB connection to do. Tap the checkmark box that says Always allow this computer and then tap the OK button.
2. Enabling Developer Mode on Your Android Device
Open the Settings Application on your Android device.
Scroll down and select About Phone. Depending on your Android device, you may have an About Device, About Tablet, or About Shield option instead.
This may be in a More section on newer Android versions.
Tap the Build Number 7 times to activate developer mode.
Once developer mode has been activated, a success message will display on the screen similar to the one below.
3. Enabling USB Debugging
Open the Settings Application on your Android device.
Navigate back to the Settings menu and select Developer Options which should now available.
In the Developer Options menu, enable USB debugging by tapping it.
When prompted, tap the OK button.
4. Verifying That Your Device is Connected
To verify that everything has been setup correctly and that your Android device is ready for UE4 development, you can do the following:
Open a Windows Command Prompt by pressing the Windows + R keys to open up the Run command dialogue box.
Inside of the Open input, type cmd and the press the OK button to open the Windows Command Prompt.
Inside of the Windows Command Prompt, input adb devices and then press the Enter key to display all connected Android devices.
Open the Terminal app from /Applications/Utilities.
Type adb devices in the command prompt and you should see all devices that are connected to your Mac.
If you still do not see your device after you input the adb devices command you can try the following items:
If the device is listed but shows Unauthorized next to the name, that indicates that you did not accept your development PC’s computer’s RSA key fingerprint.
If your device does not show up despite it being plugged in and setup, input the following commands in the following order into the Windows Command Prompt to restart the Android Debug Bridge or (ADB) service:
ADB kill — server
This will stop the ADB service.
ADB start — server
This will start the ADB service.
In some cases, a correctly configured Android device might not show up if it is connected as a Media Device (MTP). If this happens, try connecting as Camera (PTP) by selecting the Camera (PTP) option in your Use USB to options.
End Result
Once you have completed the above sections, your Android device will be ready for deployment and debugging. For further reading, we recommend that you refer to the Android Quick Start Guide to learn about configuring your project for Android in the Unreal Editor.
Источник
Setting Up Android SDK and NDK for Unreal
How to set up your Android development environment for Unreal 4.25 and later
Unreal Engine 4.25 and later uses the Android Software Development Kit (SDK) distributed with Android Studio for all essential Android development components, including the Android Native Development Kit (NDK). This page provides a walkthrough for setting up Android Studio and ensuring that Unreal Engine recognizes these components correctly, and some troubleshooting tips for managing NDK installations and earlier engine builds.
Recommended Setup
You should make sure that the Unreal Editor and the Epic Games Launcher are both closed to ensure that there are no problems with either the installation of NDK components or setting your environment variables for the engine.
If you are upgrading from Unreal 4.24 or earlier, we recommend that you uninstall CodeWorks for Android and any existing NDK components, and delete the folder CodeWorks was installed to. Otherwise, Android Studio will continue to use the previous CodeWorks installation folder for SDK updates.
The default installation directory for CodeWorks is C:/NVPACK. Make sure this folder is deleted when you finish uninstalling CodeWorks.
If you need to support an earlier installation of Unreal Engine while also maintaining an installation of Unreal 4.25 or later, refer to the sections on Manually Targeting SDK Paths and Android NDK Compatibility below.
1. Installing Android Studio
Before setting up the required SDK and NDK components on your computer, you need to install Android Studio.
Refer to Android Development Requirements for information about which Android Studio and NDK versions are compatible with your current version of Unreal Engine.
Navigate to the Android Studio Archive in your web browser. Scroll down to Android Studio 4.0, click to unfold the dropdown, and download the appropriate installer or zip file for your operating system.
Click image for full size.
Run the Android Studio installer. In the Android Studio Setup dialog, click Next to continue.
Click image for full size.
In the Choose Components dialog, click Next to continue. You can leave the default components enabled.
Click image for full size.
In the Install Locations dialog, make sure the installation location is set to the default. Click Next to continue.
Click image for full size.
If you choose a custom install location, SetupAndroid.bat will not be able to find files unless you edit it first. We highly recommend keeping the default installation location.
In the Choose Start Menu Folder, click Install to begin the installation process.
Click image for full size.
When the installation finishes, click Next to begin setting up components.
Click image for full size.
When setup completes, make sure the Start Android Studio box is checked and click Finish to exit the installer.
2. Setting Up Android Studio for First-Time Use
When you start your new install of Android Studio for the first time, follow these steps:
When the Import Android Studio Settings dialog appears, select do not import settings, then click OK to continue.
When the Data Sharing dialog appears, choose whether or not you want to send usage statistics to Google. This is an option you may choose at your discretion, and either choice will continue to the next step.
Click image for full size.
The Android Studio Setup Wizard will appear. Click Next to continue. If you are prompted for an update, click the X button to dismiss the prompt, as you need to specifically install version 4.0.
Click image for full size.
In the Install Type dialog, select Custom and click Next.
Click image for full size.
In the Select UI Theme dialog, choose your preferred theme and click Next.
Click image for full size.
In the Verify Settings dialog, check to make sure that you are using the default SDK path. Click Finish to finalize your setup and begin downloading components.
Click image for full size.
If you do not use the default SDK path, it is possible for SetupAndroid.bat to fail during a later step, as it will be unable to locate needed files.
When components are finished downloading, click Finish again to end setup.
In the Welcome to Android Studio dialog, you will see a prompt in the lower-right corner asking to update your Android Studio to the latest version. Hover over it and dismiss it without updating. This will reveal the Configure and Get Help dropdowns.
Open the Configure dropdown and click SDK Manager.
Click image for full size.
In the Android SDK system settings, click the SDK Tools tab. This will display a list of optional components.
Click image for full size.
Check the box for Android SDK Command-line Tools (latest). Click Apply to download and install this component.
If you do not install the command-line tools, SetupAndroid.bat will fail in a later step.
Click OK to dismiss the window and close the welcome dialog.
Finalizing Android Studio Installation on Your OS
If you are on Windows, restart your computer.
If you are on Linux, close your terminal window and reopen it.
If you are on MacOS, you can either close your terminal window and reopen it, or log out and log back in.
3. Setting Up Android NDK
Navigate to your Unreal Engine 4 install directory — for example, C:/Program Files/Epic Games/UE_4.25.
Open Engine/Extras/Android.
Inside this directory, run the SetupAndroid script appropriate for your operating system. SetupAndroid.bat is for Windows, SetupAndroid.command is for Mac, and SetupAndroid.sh is for Linux.
Click image for full size.
You will be prompted to accept the Android SDK license agreement. Type Y and press Enter to accept.
Click image for full size.
When the installation completes, press any key to dismiss the command prompt.
Restart your computer for all changes to take effect.
This script will download and install the required version of Android NDK for you in your Android home directory. The install directory for NDK should be C:/Users/[Username]/AppData/Local/Android/SDK/ndk/, where «username» is your login name for your computer. You should see a folder containing the required NDK version.
In the event that you receive an error stating that repositories.cfg cannot be loaded, navigate to the folder where it is expected (usually C:/Users/[Username].android/repositories ) and create an empty repositories.cfg file. Android setup should then proceed normally.
If you receive an error stating that a package called lldb;3.1 could not be loaded, open the SetupAndroid script with a text editor, and locate the line of code that reads:
Remove the entry in this list for lldb;3.1 , but leave the others. This will enable setup to run normally. This issue is addressed in Unreal Engine 4.25.1 and later.
Manually Targeting SDK Paths
If you followed the above how-to sections without encountering problems, Unreal Engine will automatically associate the SDK paths for the Android SDK, the current Android NDK version, and the Java Development Kit (JDK). However, if you are using an earlier version of the Unreal Engine alongside Android Studio, you may need to manually target your SDK paths to be compatible. This is most likely to be the case if you have an installation of Unreal Engine alongside an earlier version that used CodeWorks.
Do not install CodeWorks and Android Studio at the same time, otherwise you will receive errors. If you need to support an earlier version of Unreal Engine alongside 4.25 or later, use the Android Studio setup in this document, then follow the instructions in this section to target the path for the version of Android Studio you need.
You can find the SDK paths by opening Edit > Project Settings, navigating to the Platforms > Android > Android SDK section.
When these fields are left blank, they fall back on a set of default paths used by the installation process in the previous sections. If you have multiple installations of these components, or have installed them in non-standard directories, you can manually provide their paths here. Alternatively, you can open DefaultEngine.ini and provide them under the [/Script/AndroidPlatformEditor.AndroidSDKSettings] section.
If the entries for SDKPath , NDKPath , and JDKPath do not exist in your DefaultEngine.ini, they will use the default path to the Android home directory.
Android SDK and NDK Compatibility
The following table shows which NDK and Android Studio versions are required or compatible with different versions of Unreal Engine.
Источник