Xcode 10 | XCUITest | Incorrect value being reported screen Scale

When running following code on Physical iPhone 6/7/8 Plus device, the value of scale returned is 2. BUT doing the same on iPhone 6/7/8 Plus Simulator return 3.


XCUIApplication().launch()  
NSLog("TADA Scale Factor: \(UIScreen.main.scale)")
  • I have LaunchScreen storyboard configured in my app.
  • I have added all the required app icons.
  • My device's display setting is set to Standard.
  • Running app itself on device and getting screen scale in app delegate returns correct value i.e. 3.

Any ideas on what could be reason for this behavior. Is it a bug in XCUITest?