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

IosXcodeIos Simulator

Ios Problem Overview


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?

Ios Solutions


Solution 1 - Ios

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.

Solution 2 - Ios

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 ...

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.

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

Solution 3 - Ios

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.

Solution 4 - Ios

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

Solution 5 - Ios

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

Cmd+1 is the shortcut.

enter image description here

Solution 6 - Ios

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.

Solution 7 - Ios

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()
    // ....
}

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionPasostaView Question on Stackoverflow
Solution 1 - IosWoody HuangView Answer on Stackoverflow
Solution 2 - IosgbroekstgView Answer on Stackoverflow
Solution 3 - IosRicardo IsidroView Answer on Stackoverflow
Solution 4 - IosHugo AlonsoView Answer on Stackoverflow
Solution 5 - IosRaminView Answer on Stackoverflow
Solution 6 - IosCường NguyễnView Answer on Stackoverflow
Solution 7 - IosskimView Answer on Stackoverflow