52

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?

Eric Aya
  • 69,473
  • 35
  • 181
  • 253
Pasosta
  • 825
  • 3
  • 13
  • 22

7 Answers7

17

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.

Woody Huang
  • 462
  • 5
  • 11
  • No need to restart the simulator. You can do this pressing shortcut: cmd+1 – Zia Jul 17 '19 at 10:13
  • had this problem, yes this fixed it for me, i just manually sized the simulator to max size, and then quit, and restarted and all logs didn't come back :) – A O Oct 30 '19 at 02:55
9

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.

JerryZhou
  • 4,566
  • 3
  • 37
  • 60
gbroekstg
  • 1,055
  • 1
  • 10
  • 19
  • 5
    Warnings are gone - thanks, but is it safe to set this Environment variable to `disable`. What about other possible log entries, exceptions, etc.? – jaPawel Dec 08 '18 at 01:34
  • 3
    what does it mean? – X.Y. Dec 17 '18 at 07:03
  • 32
    OS_ACTIVITY_MODE disables all NSLog statements, you should really include that as a big caveat for writing a answer like this. – Claus Jørgensen Jan 12 '19 at 04:14
  • 11
    This answer eliminates the symptom but is completely unhelpful in understanding the underlying problem. I wish I could down vote it more than once. – Jim Mar 02 '19 at 21:02
  • I'm going to link to this answer from another question. I'm going to edit the answer to reflect these comments. – dlpolanco May 10 '19 at 20:56
  • Also related to this problem: https://stackoverflow.com/questions/50701321/xcode-error-on-simulation-mgisdeviceoneoftype-is-not-supported-on-this-platform – dlpolanco May 10 '19 at 21:18
5

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.

Ricardo Isidro
  • 426
  • 7
  • 9
2

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

Hugo Alonso
  • 6,684
  • 2
  • 34
  • 65
1

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

Cmd+1 is the shortcut.

enter image description here

Ramin
  • 335
  • 4
  • 14
1

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.

0

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()
    // ....
}
skim
  • 2,267
  • 2
  • 16
  • 17