Unable to look up screen scale and Unexpected physical screen orientation in Xcode 10

℡╲_俬逩灬. 提交于 2019-12-03 01:28:31

问题


I have recently updated Xcode to version 10, and now my console displays:

MyApp[1618:133310] [AXMediaCommon] Unable to look up screen scale
MyApp[1618:133310] [AXMediaCommon] Unexpected physical screen orientation
MyApp[1618:133310] [AXMediaCommon] Unable to look up screen scale
MyApp[1618:133310] [AXMediaCommon] Unable to look up screen scale
MyApp[1618:133310] [AXMediaCommon] Unexpected physical screen orientation

This only happens when I am running the app in the simulator. I have not changed my code since updating, and nothing appears to have broken in the app. What do these logs mean, and how can I resolve them?


回答1:


It could sounds dummy, but these warning appeared me after move the simulator previously rendered from the Macbook screen, to a wider external screen.

I solved it just restarting the simulator in the external screen. My 2 cents.




回答2:


I've met the same problem. Finally I find out that this is because I accidentally resize the simulator's screen using my mouse cursor. By quiting and restarting the simulator my problem is solved.

Hope the aforementioned information helps.




回答3:


This won't answer your original question, but it might relieve your eyes. A caveat to this answer however is that it disables all NSLog statements.

Do the following to suppress - all NSLog statements including - the warning: Unable to look up screen scale:

In Xcode, go to Product - Scheme - Edit Scheme, select 'Run' on the left side ...

... and add OS_ACTIVITY_MODE with value "disable" in the Environment variables section.




回答4:


Resizing the simulator's screen size to actual device size resolved this for me:

Cmd+1 is the shortcut.




回答5:


I got the issue, when I was running on iOS 12.2 and MacOS Majove (Version 10.14.4) Just change to iOS 11.4 and everything working perfectly.




回答6:


I encountered this issue after running some UITest from a gitlab-runner.

The simulator got into this state and the only way to solve it was to go to Hardware -> Erase all content and settings




回答7:


I've experienced something similar. If restarting simulator doesn't do the trick, check your UI test code. Make sure your setup calls super.setup() somewhere:

override func setup() {
    super.setup()
    // ....
}


来源:https://stackoverflow.com/questions/52410471/unable-to-look-up-screen-scale-and-unexpected-physical-screen-orientation-in-xco

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!