Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


AndroidHardwareProfiles

An abstract class for defining Vulkan hardware profiles that Unity includes in Android builds.
Read time 1 minuteLast updated 6 days ago

Definition

public abstract class AndroidHardwareProfiles

Remarks

Inherit from this class to define device-specific Vulkan hardware profiles for Android. At build time, Unity calls AndroidHardwareProfiles.DefineHardwareProfile to collect your profile configuration, then serializes it into a
Profile.json
file in the application's assets.
At runtime, Unity uses these profiles to configure graphics API selection, driver workarounds, and graphics jobs settings based on the device hardware.
Note: You can't use Vulkan hardware profiles and Vulkan Device Filtering Assets at the same time. When both exist, hardware profiles take precedence.
For more information, refer to Vulkan hardware profiles.

Examples

using UnityEditor.Android;using UnityEditor.HardwareProfiles;public class MyHardwareProfiles : AndroidHardwareProfiles{ public override void DefineHardwareProfile(ProfileDatabase database) { // Configure the default filter for all devices var defaultFilter = database.GetDefaultFilter(); defaultFilter.SetGraphicsAPI(GraphicsAPI.UseVulkan); // Target specific devices var pixel6 = database.CreateFilter("", "", "((G|g)oogle)", "(oriole|raven|bluejay)"); pixel6.SetGraphicsAPI(GraphicsAPI.UseOpenGles); }}

Methods

Method

Description

DefineHardwareProfileImplement this method to configure Vulkan hardware profiles for the Android build.
IsEnabledOverride this method to control whether Unity uses this hardware profile during the Android build.