onnxruntime/csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests.Mobile/EndToEndTests.Mobile.Automation/AppInitializer.cs
Scott McKay b5a652c578
Add Xamarin support (#9436)
Add Xamarin support to the ORT nuget packages.
  - Update C# code to support Xamarin builds for iOS and Android
  - refactor some things to split out common code
  - include iOS and Android ORT native shared library in native nuget package
2021-10-27 20:07:07 +10:00

32 lines
1.1 KiB
C#

using Xamarin.UITest;
namespace EndToEndTests.Mobile.Automation
{
public class AppInitializer
{
public static IApp StartApp(Platform platform)
{
// For local testing of the Android test app, run a command line Debug build first
// msbuild <path_to_repo>/csharp/test/Microsoft.ML.OnnxRuntime.Tests.Droid/Microsoft.ML.OnnxRuntime.Tests.Droid.csproj /p:Configuration=Debug /t:PackageForAndroid
if (platform == Platform.Android)
{
return ConfigureApp
.Android
#if DEBUG
.EnableLocalScreenshots()
.ApkFile("../../../../../Microsoft.ML.OnnxRuntime.Tests.Droid/bin/Release/com.microsoft.onnxruntime_tests_droid.apk")
#endif
.StartApp();
}
// For local testing of the iOS test app, install to a physical iPhone device first
return ConfigureApp
.iOS
#if DEBUG
.EnableLocalScreenshots()
.InstalledApp(bundleId: "com.Microsoft.OnnxRuntime-Tests-iOS")
#endif
.StartApp();
}
}
}