尝试在ios模拟器上运行Xamarin.UITest时遇到问题。当我在本地开始测试并通过应用程序捆绑包时,出现了DeviceAgentException异常:无法安装应用程序/path/to/App.app
我正在运行以下代码:
return ConfigureApp.iOS.DeviceIdentifier("04096CC6-B8D0-4C1C-A4CB-4F4CABCFE3D1").AppBundle("/path/to/App.app").StartApp();
并收到此错误:
SetUp : Xamarin.UITest.XDB.Exceptions.DeviceAgentException : Failed to install app /path/to/App.app
ExitCode: 134
0 CoreFoundation 0x00007fff3ba9766b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x00007fff62ce8942 objc_exception_throw + 48
10 libdyld.dylib 0x00007fff638ff015 start + 1
2 iOSDeviceManager 0x00000001058fa378 +[Command resourcesFromArgs:] + 0
3 iOSDeviceManager 0x00000001058f3a79 +[Codesigner adHocSign:resourcesToInject:] + 509
4 iOSDeviceManager 0x00000001058f33ae +[Codesigner resignApplication:withProvisioningProfile:withCodesignIdentity:resourcesToInject:] + 153
5 iOSDeviceManager 0x0000000105900d88 -[Simulator installApp:mobileProfile:codesignIdentity:resourcesToInject:forceReinstall:] + 324
6 iOSDeviceManager 0x00000001059012fd -[Simulator installApp:resourcesToInject:forceReinstall:] + 67
7 iOSDeviceManager 0x00000001058f1d57 +[InstallAppCommand execute:] + 876
8 iOSDeviceManager 0x00000001058fd222 +[CLI process:] + 1111
9 iOSDeviceManager 0x00000001058e863d main + 121
(
)
*** First throw call stack:
2018-12-20 16:35:28.395 iOSDeviceManager[2555:42598] *** Terminating app due to uncaught exception 'CBXException', reason: 'Error codesigning /path/to/App.app: '
App com.acme.appid is not installed on 04096CC6-B8D0-4C1C-A4CB-4F4CABCFE3D1
libc++abi.dylib: terminating with uncaught exception of type NSException
Stack trace:
at Xamarin.UITest.iOS.iOSAppLauncher.LaunchAppLocal (Xamarin.UITest.Configuration.IiOSAppConfiguration appConfiguration, Xamarin.UITest.Shared.Http.HttpClient httpClient, System.Boolean clearAppData) [0x001e2] in <fd164790b61b4dd4848a99fcb06e7e4b>:0
at Xamarin.UITest.iOS.iOSAppLauncher.LaunchApp (Xamarin.UITest.Configuration.IiOSAppConfiguration appConfiguration, Xamarin.UITest.Shared.Http.HttpClient httpClient, Xamarin.UITest.TestCloud.TestCloudiOSAppConfiguration testCloudAppConfiguration, Xamarin.UITest.Shared.Http.HttpClient testCloudWsClient, Xamarin.UITest.Shared.Http.HttpClient xtcServicesClient, System.Boolean testCloudUseDeviceAgent) [0x00068] in <fd164790b61b4dd4848a99fcb06e7e4b>:0
at Xamarin.UITest.iOS.iOSApp..ctor (Xamarin.UITest.Configuration.IiOSAppConfiguration appConfiguration, Xamarin.UITest.Shared.Execution.IExecutor executor) [0x002af] in <fd164790b61b4dd4848a99fcb06e7e4b>:0
at Xamarin.UITest.iOS.iOSApp..ctor (Xamarin.UITest.Configuration.IiOSAppConfiguration appConfiguration) [0x00000] in <fd164790b61b4dd4848a99fcb06e7e4b>:0
at Xamarin.UITest.Configuration.iOSAppConfigurator.StartApp (Xamarin.UITest.Configuration.AppDataMode appDataMode) [0x00017] in <fd164790b61b4dd4848a99fcb06e7e4b>:0
at MobileTesting.AppInitializer.StartApp (Xamarin.UITest.Platform platform) [0x00022] in /Users/bh185120/OneDrive - NCR Corporation/MobileTesting/MobileTesting/AppInitializer.cs:17
at MobileTesting.Tests.BeforeEachTest () [0x00001] in /Users/bh185120/OneDrive - NCR Corporation/MobileTesting/MobileTesting/Tests.cs:27
at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke(System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0003b] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-06/external/bockbuild/builds/mono-x64/mcs/class/corlib/System.Reflection/MonoMethod.cs:305
更新:
/path/to/App.app只是示例,我在我正在运行的代码中拥有我的应用程序的完整路径
我正在使用以下版本的apps / os / frameworks: