From a9e13715febc38d33e73632de1f248ffc70a022b Mon Sep 17 00:00:00 2001 From: Natalie Bunduwongse Date: Tue, 5 Nov 2024 14:04:31 +1300 Subject: [PATCH] test: ability to specify host for mobile builder --- sample/Assets/Editor/MobileBuilder.cs | 15 ++++++++++++++- sample/Assets/Scenes/SelectAuthMethod.unity | 12 ++++++------ sample/ProjectSettings/ProjectSettings.asset | 2 +- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/sample/Assets/Editor/MobileBuilder.cs b/sample/Assets/Editor/MobileBuilder.cs index da06770f..75b48380 100644 --- a/sample/Assets/Editor/MobileBuilder.cs +++ b/sample/Assets/Editor/MobileBuilder.cs @@ -79,6 +79,19 @@ private static BuildTarget GetPlatformFromArgs() return BuildTarget.Android; // Default to Android if no platform is specified } + private static string GetAltTesterHostFromArgs() + { + string[] args = Environment.GetCommandLineArgs(); + for (int i = 0; i < args.Length; i++) + { + if (args[i] == "--host" && i + 1 < args.Length) + { + return args[i + 1]; + } + } + return null; + } + private static BuildPlayerOptions CreateBuildPlayerOptions(string buildPath, BuildOptions buildOptions, BuildTarget platform) { return new BuildPlayerOptions @@ -106,7 +119,7 @@ private static void SetupAltTester(BuildPlayerOptions buildPlayerOptions, BuildT AltBuilder.CreateJsonFileForInputMappingOfAxis(); var instrumentationSettings = new AltInstrumentationSettings(); - var host = System.Environment.GetEnvironmentVariable("ALTSERVER_HOST"); + var host = System.Environment.GetEnvironmentVariable("ALTSERVER_HOST") ?? GetAltTesterHostFromArgs(); if (!string.IsNullOrEmpty(host)) { instrumentationSettings.AltServerHost = host; diff --git a/sample/Assets/Scenes/SelectAuthMethod.unity b/sample/Assets/Scenes/SelectAuthMethod.unity index f16c03e3..1c2eb98f 100644 --- a/sample/Assets/Scenes/SelectAuthMethod.unity +++ b/sample/Assets/Scenes/SelectAuthMethod.unity @@ -206,7 +206,7 @@ MonoBehaviour: m_TargetGraphic: {fileID: 416242725} m_HandleRect: {fileID: 416242724} m_Direction: 0 - m_Value: 0 + m_Value: 1 m_Size: 0.9999999 m_NumberOfSteps: 0 m_OnValueChanged: @@ -1323,7 +1323,7 @@ MonoBehaviour: m_TargetGraphic: {fileID: 167431872} m_HandleRect: {fileID: 167431871} m_Direction: 2 - m_Value: 0 + m_Value: 1 m_Size: 1 m_NumberOfSteps: 0 m_OnValueChanged: @@ -1673,8 +1673,8 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 1259.3727, y: 0} - m_SizeDelta: {x: 2478.7454, y: 0} + m_AnchoredPosition: {x: 1161.847, y: 0} + m_SizeDelta: {x: 2283.694, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1661390145 MonoBehaviour: @@ -1768,8 +1768,8 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 1259.3727, y: 0} - m_SizeDelta: {x: 2478.7454, y: 0} + m_AnchoredPosition: {x: 1161.847, y: 0} + m_SizeDelta: {x: 2283.694, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1688502349 MonoBehaviour: diff --git a/sample/ProjectSettings/ProjectSettings.asset b/sample/ProjectSettings/ProjectSettings.asset index 0b2facda..49d6f249 100644 --- a/sample/ProjectSettings/ProjectSettings.asset +++ b/sample/ProjectSettings/ProjectSettings.asset @@ -797,7 +797,7 @@ PlayerSettings: WebGL: 1 Windows Store Apps: 1 XboxOne: 1 - iPhone: 3 + iPhone: 4 tvOS: 1 incrementalIl2cppBuild: {} suppressCommonWarnings: 1