2

我正在尝试在 iOS 平台上运行 UITest 的演示。即使构建项目没有问题,我也无法运行 UI 测试。

这是错误信息:

SetUp : Calabash.XDB.Core.Exceptions.DeviceAgentException : Failed to launch simulator

ExitCode: 134
2016-11-23 12:00:01.767 iOSDeviceManager[36474:1504101] CoreSimulator: Loading from /Applications/Xcode 8.2-beta.app/Contents/Developer/Library/PrivateFrameworks/CoreSimulator.framework 
2016-11-23 12:00:01.772 iOSDeviceManager[36474:1504101] CoreSimulator: Successfully loaded
2016-11-23 12:00:01.773 iOSDeviceManager[36474:1504101] CoreSimulator: SimDevice has correct path of /Applications/Xcode 8.2-beta.app
2016-11-23 12:00:01.773 iOSDeviceManager[36474:1504101] SimulatorKit: Loading from /Applications/Xcode 8.2-beta.app/Contents/Developer/Library/PrivateFrameworks/SimulatorKit.framework 
2016-11-23 12:00:01.795 iOSDeviceManager[36474:1504101] SimulatorKit: Successfully loaded
2016-11-23 12:00:01.795 iOSDeviceManager[36474:1504101] SimulatorKit: SimDeviceFramebufferService has correct path of /Applications/Xcode 8.2-beta.app
2016-11-23 12:00:01.796 iOSDeviceManager[36474:1504101] Loaded All Private Frameworks [CoreSimulator, SimulatorKit]
2016-11-23 12:00:01.883 iOSDeviceManager[36474:1504101] Completed Pool Preconditons
2016-11-23 12:00:01.939 iOSDeviceManager[36474:1504101] *** Assertion failure in -[FBSimulatorConfiguration initWithNamedDevice:os:auxillaryDirectory:], /Users/chrisf/FBSimulatorControl/FBSimulatorControl/Configuration/FBSimulatorConfiguration.m:32
2016-11-23 12:00:02.056 iOSDeviceManager[36474:1504101] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: os'
*** First throw call stack:
(
    0   CoreFoundation                      0x00007fff832256fb __exceptionPreprocess + 171
    1   libobjc.A.dylib                     0x00007fff97a2ca2a objc_exception_throw + 48
    2   CoreFoundation                      0x00007fff8322a252 +[NSException raise:format:arguments:] + 98
    3   Foundation                          0x00007fff84c7d390 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 195
    4   FBSimulatorControl                  0x000000010d2cef3f -[FBSimulatorConfiguration initWithNamedDevice:os:auxillaryDirectory:] + 444
    5   FBSimulatorControl                  0x000000010d2cf0a3 __48+[FBSimulatorConfiguration defaultConfiguration]_block_invoke + 108
    6   libdispatch.dylib                   0x00007fff982d3128 _dispatch_client_callout + 8
    7   libdispatch.dylib                   0x00007fff982d30e5 dispatch_once_f + 38
    8   FBSimulatorControl                  0x000000010d2cf034 +[FBSimulatorConfiguration defaultConfiguration] + 45
    9   FBSimulatorControl                  0x000000010d2fc253 +[FBSimulatorConfiguration(CoreSimulator) inferSimulatorConfigurationFromDevice:error:] + 347
    10  FBSimulatorControl                  0x000000010d2f657f +[FBSimulator fromSimDevice:configuration:launchdSimProcess:containerApplicationProcess:set:] + 178
    11  FBSimulatorControl                  0x000000010d2f8157 -[FBSimulatorInflationStrategy inflateSimulators:availableDevices:previouslyIdentifiedContainerApplications:] + 810
    12  FBSimulatorControl                  0x000000010d2f7db8 -[FBSimulatorInflationStrategy inflateFromDevices:exitingSimulators:] + 891
    13  FBSimulatorControl                  0x000000010d2d615d -[FBSimulatorSet allSimulators] + 129
    14  FBSimulatorControl                  0x000000010d2d45d5 -[FBSimulatorSet query:] + 108
    15  iOSDeviceManager                    0x000000010d1609c1 +[Simulator simulatorWithDeviceID:] + 238
    16  iOSDeviceManager                    0x000000010d1614f5 +[Simulator launchSimulator:] + 88
    17  iOSDeviceManager                    0x000000010d161ec7 +[LaunchSimulatorCommand execute:] + 74
    18  iOSDeviceManager                    0x000000010d15cd4a +[CLI process:] + 1171
    19  iOSDeviceManager                    0x000000010d121504 main + 104
    20  libdyld.dylib                       0x00007fff98309255 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
4

1 回答 1

0

我正在使用 Xamarin 测试云来运行 Xamarin android 和 xamarin ios 项目的 UITest。我都试过了。对于 Xamarin.ios 项目,我的设置方法如下所示,

app = ConfigureApp .iOS .PreferIdeSettings() .StartApp();

按照默认 UITest 中的说明,您需要执行以下步骤。编辑 AppDelegate 类并将以下代码段添加到 FinishedLaunching 方法...

#if ENABLE_TEST_CLOUD
Xamarin.Calabash.Start();
#万一

确保在项目的调试配置中添加“ENABLE_TEST_CLOUD”调试变量或删除 if、endif(始终允许 Xamarin.calabash.start()。并将 UiTest 从发布配置构建发布到 xamarin 测试云。只要确保在这种情况下, 将应用提交到应用商店时删除上述声明。

在单元测试窗口(Xamarin 工作室)中,添加 ios 应用程序,然后使用测试云运行测试。确保您有 xamarin 帐户在测试云上运行测试。

然后它询问将在哪个测试上运行的设备。您可以选择 1 个或多个。

于 2016-12-05T10:04:31.987 回答