文档

Unity Engine

Unity Engine

AndroidLaunchReport

Provides information about the application launched on Android devices.
阅读时间1 分钟最后更新于 1 个月前

Definition

public class AndroidLaunchReport : DefaultLaunchReport

Remarks

Use this class to get information about the application launched on multiple devices at the same time.

Examples

using UnityEngine;using UnityEditor;using UnityEditor.Build;public class PostLaunchCallback : IPostprocessLaunch{ public int callbackOrder => 0; private void Log(string message) { Debug.LogFormat(LogType.Log, LogOption.NoStacktrace, null, message); } public void OnPostprocessLaunch(ILaunchReport launchReport) { Log($"Launch callback on {launchReport.buildTarget.TargetName.ToString()}, result: {launchReport.result}");#if UNITY_ANDROID var androidLaunchReport = UnityEditor.Android.AndroidLaunchReportExtensions.AsAndroidReport(launchReport); if (androidLaunchReport != null) { foreach (var launch in androidLaunchReport.Launches) { Log($"Running '{launch.PackageName}/{launch.ActivityName}' on device '{launch.DeviceId}', Success: {launch.Success}, errors: {launch.Errors}"); } }#endif }}

Properties

Property

Description

LaunchesAn array containing information about the application launched on multiple Android devices.

Classes

Class

Description

AndroidLaunchReport.LaunchProvides information about the application launched on a single Android device.