Skip to content

[DX-3432] test: ability to specify host for mobile builder #343

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion sample/Assets/Editor/MobileBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down
12 changes: 6 additions & 6 deletions sample/Assets/Scenes/SelectAuthMethod.unity
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion sample/ProjectSettings/ProjectSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,7 @@ PlayerSettings:
WebGL: 1
Windows Store Apps: 1
XboxOne: 1
iPhone: 3
iPhone: 4
tvOS: 1
incrementalIl2cppBuild: {}
suppressCommonWarnings: 1
Expand Down
Loading