模拟器上的Xcode错误:此平台不支持MGIsDeviceOneOfType [英] Xcode Error on Simulator: MGIsDeviceOneOfType is not supported on this platform
问题描述
我有一个非常简单的应用程序,具有一个视图,其中包含多个UILabel.在Simulator中运行时,Xcode控制台返回错误:
I have a very simple application with a single view, containing several UILabels. Upon running in Simulator, the Xcode console returns the error:
libMobileGestalt MobileGestalt.c:875:此平台不支持MGIsDeviceOneOfType.
libMobileGestalt MobileGestalt.c:875: MGIsDeviceOneOfType is not supported on this platform.
模拟器本身仅显示白屏.我也尝试过在具有相同白屏的开发人员设备上运行它.我已经搜索了文档,但是找不到对MGIsDeviceOneOfType
的任何引用.
该应用程序是在macOS 10.14上的Xcode 10 beta中用Swift编写的.我正在尝试在运行目标软件(12.0)的iPhone 7-X Simulator和开发版iPhone 7上运行它.
The Simulator itself just shows a white screen. I've also tried running it on a developer device with the same white screen. I've searched documentation but can't find any reference to MGIsDeviceOneOfType
.
The application is written in Swift in Xcode 10 beta on macOS 10.14. I am attempting to run it on the iPhone 7-X Simulators, as well as a development iPhone 7, all running the target software (12.0).
推荐答案
MobileGestalt
libMobileGestalt.dylib 为iOS的所有属性提供了一个中央存储库.它可以类似于OS X的格式塔(Gestalt),它是CoreServices
的一部分. OS X的格式塔记录了例如格式塔管理器,自10.8起已弃用. Apple完全没有记录 MobileGestalt ,因为它是一个私有库.
The libMobileGestalt.dylib provides a central repository for all of the iOS's properties. It can be analogous to OS X's Gestalt, which is part of CoreServices
. OS X's Gestalt is documented for example Gestalt Manager and has been deprecated as of 10.8. MobileGestalt is entirely undocumented by Apple as it is a private library.
MobileGestalt允许测试可能在不同模拟器上兼容或不兼容的系统属性.
MobileGestalt allows for the testing of system properties that may or may not be compatible on different simulators.
iOS中有很多系统进程和应用程序都依赖于MobileGestalt,该文件位于/usr/lib/libMobileGestalt.dylib.它更像是一个基本库,但是其公开的API遵循Apple框架约定,并使用MG
API前缀(例如MGIsDeviceOneOfType
).
Quite a few system processes and apps in iOS rely on MobileGestalt, which is located at /usr/lib/libMobileGestalt.dylib. It's more of a basic library, but its exposed APIs follow the Apple framework conventions and uses the MG
API prefix for example MGIsDeviceOneOfType
.
如果您在iOS文件系统上寻找MobileGestalt,则找不到它-像所有私有框架和库一样,它已经预链接到/System/Library/Caches/...etc.如果您喜欢黑客和笔测试,则可以使用工具将其提取.
If you look for MobileGestalt on the iOS filesystem you won't find it - like all private frameworks and libraries, it has been prelinked into the /System/Library/Caches/...etc. If you like hacking and pen-testing then you can use tools to extract it.
MobileGestalt提供了大量有关系统各个方面的信息-大约200个查询.这里有一些.
MobileGestalt provides plenty of information - around 200 or so queries - on various aspects of the system. Here are a few.
libMobileGestalt.dylib
//Answers to MG queries
MGCopyAnswer(@"5MSZn7w3nnJp22VbpqaxLQ");
MGCopyAnswer(@"7mV26K/1a+wTtqiunvHMUQ");
MGCopyAnswer(@"BasebandAPTimeSync");
MGCopyAnswer(@"BasebandPostponementStatus");
MGCopyAnswer(@"BasebandPostponementStatusBlob");
MGCopyAnswer(@"BasebandSecurityInfoBlob");
MGCopyAnswer(@"BasebandStatus");
MGCopyAnswer(@"BuildVersion");
MGCopyAnswer(@"CoreRoutineCapability");
MGCopyAnswer(@"DeviceClass");
MGCopyAnswer(@"DeviceClassNumber");
MGCopyAnswer(@"DeviceName");
MGCopyAnswer(@"DeviceSupports1080p");
MGCopyAnswer(@"DeviceSupports720p");
MGCopyAnswer(@"DiskUsage");
MGCopyAnswer(@"GSDeviceName");
MGCopyAnswer(@"HWModelStr");
MGCopyAnswer(@"HasBaseband");
MGCopyAnswer(@"InternalBuild");
MGCopyAnswer(@"InverseDeviceID");
MGCopyAnswer(@"IsSimulator");
MGCopyAnswer(@"MLBSerialNumber");
MGCopyAnswer(@"MaxH264PlaybackLevel");
MGCopyAnswer(@"MinimumSupportediTunesVersion");
MGCopyAnswer(@"PasswordConfigured");
MGCopyAnswer(@"PasswordProtected");
MGCopyAnswer(@"ProductType");
MGCopyAnswer(@"ProductVersion");
MGCopyAnswer(@"RegionCode");
MGCopyAnswer(@"RegionalBehaviorNTSC");
MGCopyAnswer(@"RegionalBehaviorNoPasscodeLocationTiles");
MGCopyAnswer(@"ReleaseType");
MGCopyAnswer(@"SIMStatus");
还有数百个AirplaneMode
,MobileEquipmentIdentifier
等
MobileGestalt维护OSType选择器代码的表.
例如消息中的 c:890 : libMobileGestalt MobileGestalt.c:890:此平台不支持MGIsDeviceOneOfType.在这种情况下,MGIsDeviceOneOfType
是 MobileGestalt库.
MobileGestalt maintains a table of OSType selector codes.
for example c:890 in the message: libMobileGestalt MobileGestalt.c:890: MGIsDeviceOneOfType is not supported on this platform. In this case MGIsDeviceOneOfType
is a method of the MobileGestalt library.
代替检查模拟器版本,有一个单独的选择器可以直接查询模拟器的功能.该消息很可能表明模拟器版本与Xcode版本和/或模拟器上不受支持的API之间不兼容.
Instead of checking the simulator version there is a separate selector for directly querying the capabilities of the simulator. The messages most likely indicate incompatibilities between simulator versions and Xcode versions and/or unsupported APIs on the simulator.
这篇关于模拟器上的Xcode错误:此平台不支持MGIsDeviceOneOfType的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!