시뮬레이터의 Xcode 오류 :이 플랫폼에서는 MGIsDeviceOneOfType이 지원되지 않습니다.
여러 UILabel을 포함하는 단일보기가있는 매우 간단한 응용 프로그램이 있습니다. Simulator에서 실행하면 Xcode 콘솔이 오류를 반환합니다.
libMobileGestalt MobileGestalt.c : 875 : MGIsDeviceOneOfType은이 플랫폼에서 지원되지 않습니다.
시뮬레이터 자체는 흰색 화면 만 표시합니다. 동일한 흰색 화면으로 개발자 장치에서 실행 해 보았습니다. 문서를 검색했지만에 대한 참조를 찾을 수 없습니다 MGIsDeviceOneOfType
. 이 애플리케이션은 macOS 10.14의 Xcode 10 베타에서 Swift로 작성되었습니다. 저는 iPhone 7-X 시뮬레이터와 개발 용 iPhone 7에서 모두 대상 소프트웨어 (12.0)를 실행하는 것으로 실행하려고합니다.
MobileGestalt
libMobileGestalt.dylib는 아이폰 OS의 모든 속성에 대한 중앙 저장소를 제공합니다. OS X의 Gestalt와 유사 할 수 있습니다 CoreServices
. OS X의 Gestalt는 예를 들어 Gestalt Manager에 대해 문서화 되어 있으며 10.8부터 더 이상 사용되지 않습니다. MobileGestalt 는 개인 라이브러리이므로 Apple에서 완전히 문서화하지 않았습니다 .
MobileGestalt를 사용하면 다른 시뮬레이터에서 호환되거나 호환되지 않을 수있는 시스템 속성을 테스트 할 수 있습니다.
iOS의 상당수 시스템 프로세스와 앱은 /usr/lib/libMobileGestalt.dylib에있는 MobileGestalt에 의존합니다. 기본 라이브러리에 가깝지만 노출 된 API는 Apple 프레임 워크 규칙을 따르며 MG
예를 들어 API 접두사를 사용합니다 MGIsDeviceOneOfType
.
iOS 파일 시스템에서 MobileGestalt를 찾으면 찾을 수 없습니다. 모든 개인 프레임 워크 및 라이브러리와 마찬가지로 /System/Library/Caches/...etc에 미리 링크되어 있습니다. 해킹 및 펜 테스트를 좋아한다면 도구를 사용하여 추출 할 수 있습니다.
MobileGestalt는 시스템의 다양한 측면에 대한 많은 정보 (약 200 개 정도의 쿼리)를 제공합니다. 다음은 몇 가지입니다.
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 라이브러리 의 방법입니다 .
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.
I've successfully dropped it with the disabling of the project garbage.
Go to <Name of your Project>->Scheme->Edit Scheme Then go to Run (menu to the left side) and add the following environment variable:
Name:OS_ACTIVITY_MODE, Value: disable
in my case: check your app delegate for method - didFinishLaunching. I had private and get the error. After remove "private" everything works fine
I just installed Xcode 10 Beta and had the same problem. Ran Xcode 9.4.1 and the problem went away.
This error will only occur when testing/debugging on simulators.
The newer the simulator the better.
Case: I run simulator iPhone 8 plus I got this message in the debugger.
Solution: I changed to a newer simulator no error message in the debugger.
Ran into this when opening some project from GitHub on Xcode 10.0.
The pragmatic solution was: just hit 'Continue program execution' multiple times and probably disable your exception breakpoint. Apparently the exception was recoverable.
It's not a real solution but it was good enough for me at that point.
In my case, the Target's Deployment Target was at iOS 8. When I pushed it up to iOS 10.3, it ran fine, both on the Simulator and the device.
Am seeing this problem. Using Xcode 10.1. Created a brand new project - doesn't do anything except show a white screen. Discovered it was showing up on simulator for older devices. For example, iPad Pro (12.9 inch) and iPad Pro (12.9 inch) (2nd generation) show the problem, but problem is gone for iPad Pro (12.9 inch) (3rd generation). Does not show up for iPhone XR simulator.
Basically seems annoying.
If you have fonts provided by the app, you need to add to Info.plist And check if the file have the Target Membership selected
For me, with the simulator in question in focus, I selected Hardware->Erase all content and settings.
After the simulator restarted, launching my app worked again, as expected.
I went to XCode -> Preferences -> Components Ticked all the simulators and the check box to install updates automatically, and then "check and Install now" and went away for a few hours while they all updated.
Now the problem is gone - so in fact, it's as mentioned. New XCode with Old - non-updated simulators.
I had the same issue, but with MapKit, where a MapView did not show up, just the white screen and the same error, MGIsDeviceOneOfType is not supported on this platform.
Solved it by fixing "Ambiguous layout" warnings tied to the MapView object. Now it's working perfectly fine, and the errors went away.
The regular way when strange errors happens helped:
1) Clean project;
2) Shut down simulator;
3) Reinstall pods.
Xcode 10.
What worked for me was to change within general > Deployment Info > Main Interface
to CDVLaunchScreen and do the same within general > App Icons and Launch Images > Launch Screen File
to CDVLaunchScreen as well.
I come from Ionic, so this might not be a problem for those who develop in Swift / Objective-C.
I have recently updated to Xcode 10.2
and when I tried to run a project created in earlier version, Same error occurred.
The problem was that simulator was running before updating Xcode.
Solution was very simple for me to quit Simulator and restart so that it can get the new changes. I don't think the model of the simulator (iPhone SE or iPhone X) matters. You just need to restart your simulator for it to take effect of new update.
I would recommend to quit both Xcode and simulator and restart your Mac.
I got this error by calling .sync
on the main queue which caused a deadlock (DispatchQueue.main.sync {}
). I meant to call .async
.
I got this error, when trying to read a json file which is inside my project and it returned nil, due to that i got this error.
I got nil because of some spelling mistake in the font name, that json file was holding the font names, after copy pasting the font name i got data and the error fixed.
I tried allmost all of the solutions given above, nothing worked, So debug with patience, you will get to know which is causing this error and in some bad time xcode will play in our life :)
'programing tip' 카테고리의 다른 글
클래스가 서브 클래 싱 될 때 코드를 실행하는 방법은 무엇입니까? (0) | 2020.09.02 |
---|---|
CORS Origin 헤더와 CSRF 토큰을 사용한 CSRF 보호 (0) | 2020.09.02 |
Android NFC 전화가 NFC 태그 역할을 할 수 있습니까? (0) | 2020.09.02 |
Node.js 이벤트 시스템은 Akka의 행위자 패턴과 어떻게 다른가요? (0) | 2020.09.02 |
IDLE 대화 형 쉘에서 파이썬 스크립트를 실행하는 방법은 무엇입니까? (0) | 2020.09.01 |