我已经下载了新的第9版XCode,我发现~/Xcode.app/Contents/Developer/Library/PrivateFrameworks
中没有CoreSimulator.framework。
使用Xamarin Studio,我可以在模拟器上运行应用程序,但是,当尝试运行测试时,它不成功,因为此Xcode版本中不存在此框架。
我发现在Xcode 8中存在框架。是否有可能将此框架导入新的Xcode? p>
答案 0 :(得分:1)
Xcode 9使用 SimulatorKit.framework
代替较旧的CoreSimulator.framework
。
您需要更新到最新的Visual Studio(Windows或Mac),因为已弃用的 Xamarin Studio不支持Xcode 9。
/Applications/Xcode9.app/Contents/Developer/Library/PrivateFrameworks
❯ tree
.
└── SimulatorKit.framework
├── Modules -> Versions/Current/Modules
├── Resources -> Versions/Current/Resources
├── SimulatorKit -> Versions/Current/SimulatorKit
└── Versions
├── A
│ ├── Modules
│ │ ├── SimulatorKit.swiftmodule
│ │ │ ├── x86_64.swiftdoc
│ │ │ └── x86_64.swiftmodule
│ │ └── module.modulemap
│ ├── Resources
│ │ ├── CoreSimMetalLibrary.metallib
│ │ ├── Info.plist
│ │ ├── en.lproj
│ │ │ ├── InfoPlist.strings
│ │ │ └── Localizable.strings
│ │ └── version.plist
│ ├── SimulatorKit
│ └── _CodeSignature
│ └── CodeResources
└── Current -> A
答案 1 :(得分:1)
好吧,我必须感谢@SushiHangover提供的线索。
我以前使用的是Visual Studio for Mac(版本7.1.xxx)和Xcode 9.4.2,最近又更新了它们。因此,我有一个使用这些旧环境创建的Xamarin解决方案。现在,我将两个工具都更新为Xcode 10和Visual Studio for Mac 7.6.2,然后尝试在VS for Mac上运行Xamarin.UITest,然后出现如下错误:
SetUp : Calabash.XDB.Core.Exceptions.DeviceAgentException : Failed to launch simulator
ExitCode: 134
0 CoreFoundation 0x00007fff4314243d __exceptionPreprocess + 256
1 libobjc.A.dylib 0x00007fff6f053720 objc_exception_throw + 48
10 libobjc.A.dylib 0x00007fff6f056248 CALLING_SOME_+initialize_METHOD + 19
11 libobjc.A.dylib 0x00007fff6f04600c _class_initialize + 282
12 libobjc.A.dylib 0x00007fff6f045a19 lookUpImpOrForward + 238
13 libobjc.A.dylib 0x00007fff6f045494 _objc_msgSend_uncached + 68
14 iOSDeviceManager 0x0000000103501fdf +[Device withID:] + 105
15 iOSDeviceManager 0x000000010350705e +[Command simulatorFromArgs:] + 227
16 iOSDeviceManager 0x0000000103513803 +[LaunchSimulatorCommand execute:] + 20
17 iOSDeviceManager 0x0000000103509285 +[CLI process:] + 1106
18 iOSDeviceManager 0x00000001034d69a1 main + 121
19 libdyld.dylib 0x00007fff70121085 start + 1
2 CoreFoundation 0x00007fff4315d08e +[NSException raise:format:arguments:] + 98
3 Foundation 0x00007fff454f955d -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 194
4 FBControlCore 0x00000001035cc84b +[FBControlCoreFrameworkLoader loadPrivateFrameworksOrAbort] + 462
5 libobjc.A.dylib 0x00007fff6f056248 CALLING_SOME_+initialize_METHOD + 19
6 libobjc.A.dylib 0x00007fff6f04600c _class_initialize + 282
7 libobjc.A.dylib 0x00007fff6f045a19 lookUpImpOrForward + 238
8 libobjc.A.dylib 0x00007fff6f045494 _objc_msgSend_uncached + 68
9 iOSDeviceManager 0x000000010350db41 +[Simulator initialize] + 40
(
)
*** First throw call stack:
2018-10-22 09:23:08.055 iOSDeviceManager[1586:180576] *** Assertion failure in +[FBSimulatorControlFrameworkLoader loadPrivateFrameworksOrAbort], /Users/moody/git/calabash/FBSimulatorControl/FBControlCore/Utility/FBControlCoreFrameworkLoader.m:41
2018-10-22 09:23:08.058 iOSDeviceManager[1586:180576] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Failed to private frameworks for FBSimulatorControl with error Error Domain=com.facebook.FBControlCore Code=0 "Attempting to load a file at path '/Applications/Xcode-10.app/Contents/Developer/Library/PrivateFrameworks/CoreSimulator.framework', but it does not exist" UserInfo={NSLocalizedDescription=Attempting to load a file at path '/Applications/Xcode-10.app/Contents/Developer/Library/PrivateFrameworks/CoreSimulator.framework', but it does not exist}'
libc++abi.dylib: terminating with uncaught exception of type NSException
所以我要做的就是更新一些在“解决方案资源管理器”面板中表示的可用更新,如下所示:
右键单击“程序包”并更新,然后清洁解决方案,然后尝试再次重新运行UITest,这一次很可能应该在所有平台上成功运行(以我为例,在iPhone模拟器和Android中)模拟器)。
希望这对大家都有帮助!