You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
52 lines
1.2 KiB
C#
52 lines
1.2 KiB
C#
using System.Collections.Generic;
|
|
using AutomationTool;
|
|
using UnrealBuildTool;
|
|
|
|
namespace AutomationScripts.Automation
|
|
{
|
|
public class ListMobileDevices : BuildCommand
|
|
{
|
|
public override void ExecuteBuild()
|
|
{
|
|
Log("======= ListMobileDevices - Start =======");
|
|
|
|
var GlobalParams = new ProjectParams(
|
|
Command: this,
|
|
RawProjectPath: @"D:\UE-Main\UE4\Samples\Games\TappyChicken\TappyChicken.uproject"
|
|
);
|
|
|
|
if (ParseParam("android"))
|
|
{
|
|
GetConnectedDevices(GlobalParams, Platform.Platforms[UnrealTargetPlatform.Android]);
|
|
}
|
|
|
|
if (ParseParam("ios"))
|
|
{
|
|
throw new AutomationException("iOS is not yet implemented.");
|
|
}
|
|
|
|
Log("======= ListMobileDevices - Done ========");
|
|
}
|
|
|
|
private static void GetConnectedDevices(ProjectParams Params, Platform TargetPlatform)
|
|
{
|
|
var PlatformName = TargetPlatform.PlatformType.ToString();
|
|
List<string> ConnectedDevices;
|
|
TargetPlatform.GetConnectedDevices(Params, out ConnectedDevices);
|
|
|
|
try
|
|
{
|
|
foreach (var DeviceName in ConnectedDevices)
|
|
{
|
|
Log("Device:{0}:{1}", PlatformName, DeviceName);
|
|
}
|
|
}
|
|
catch
|
|
{
|
|
throw new AutomationException("No {0} devices", PlatformName);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|