AndroidExternalToolsSettings

class in UnityEditor.Android

Description

Contains properties to modify Android specific settings in the External Tools window accessible through the Preferences window.

It allows you to customize Android development tools by defining paths to the Android SDK, NDK, and other dependencies for your project.

using UnityEngine; 
using UnityEditor;
using UnityEditor.Android;

public class AndroidExternalToolsSettingsSample { [MenuItem("Tools/Set Android External Tools settings")] public static void SetAndroidExternalToolsSettings() { // Set a custom path for the Java Development Kit (JDK). // Replace this with the actual path. AndroidExternalToolsSettings.jdkRootPath = "/path/to/your/jdk"; Debug.Log($"Custom JDK Path set to: {AndroidExternalToolsSettings.jdkRootPath}");

// Set a custom maximum heap size for the JVM (in MB). Example: 1024 MB // Ensure the value is at least the minimum allowed (128 MB) int customHeapSize = 1024; if (customHeapSize >= 128) { AndroidExternalToolsSettings.maxJvmHeapSize = 1024; Debug.Log($"Max JVM Heap Size set to: {AndroidExternalToolsSettings.maxJvmHeapSize} MB"); } else { Debug.LogError($"Invalid heap size. The value must be at least 128 MB."); } } }

Static Properties

Property Description
gradlePathPath to the Gradle used for building Android applications.
gradleUserHomePathPath to the Gradle User Home directory.
jdkRootPathPath to the Java Development Kit (JDK) used for building Android applications.
keystoresDedicatedLocationPath to a location dedicated to keystores for signing Android applications.
maxJvmHeapSizeThe maximum java heap size (in megabytes) that will be used for building Android applications.
ndkRootPathPath to the Android Native Development Kit (NDK) used for building Android applications.
sdkRootPathPath to the Android Software Development Kit (SDK) used for building Android applications.
stopGradleDaemonsOnExitIf enabled, all Gradle daemons stop when the Unity Editor exits.

Did you find this page useful? Please give it a rating: