我最近將Xcode更新到版本10,現在我的控制檯顯示:
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
這隻發生在我在模擬器中運行應用程序時。自更新以來,我沒有更改我的代碼,應用程序中似乎沒有任何內容破壞。這些日誌意味着什麼,我該如何解決它們?
經過查找資料和反覆驗證找到了解決辦法:
在Xcode中,轉到Product - Scheme - Edit Scheme,選擇左側的’Run’,並在’Environment variables’部分中添加值爲’disable’的OS_ACTIVITY_MODE。