我刚开始使用UIAutomation使用https://github.com/KrauseFx/snapshot截取我的应用的屏幕截图。
我的问题:
该应用程序编译,模拟器似乎打开应用程序,但只是显示一个黑屏。这有什么不对吗?
如果我通过XCode运行应用程序,一切正常。
#import "SnapshotHelper.js"
var target = UIATarget.localTarget();
var app = target.frontMostApp();
var window = app.mainWindow();
target.delay(3)
target.frontMostApp().mainWindow().buttons()["Info"].tap();
captureLocalizedScreenshot("0-LandingScreen")
我收到了这个日志,但不知道如何阅读。
Jan 16 09:57:42 XXXXXXSpringBoard[2986]: Normal message received by listener connection. Ignoring.
Jan 16 09:57:42 XXXXXXgeod[3026]: Failed to get the user name
Jan 16 09:57:42 XXXXXX com.apple.CoreSimulator.SimDevice.8F26A917-B953-4545-924F-2D29FD00DD2F.launchd_sim[2973] (com.apple.xpc.launchd.domain.system): Could not read path: 2: No such file or directory
path: /System/Library/NanoLaunchDaemons
Jan 16 09:57:42 XXXXXXnanoregistrylaunchd[3028]: Failed to enable path: code = 2: No such file or directory, /System/Library/NanoLaunchDaemons
Jan 16 09:57:42 XXXXXXSpringBoard[2986]: table drop: 101
Jan 16 09:57:44 XXXXXXsyncdefaultsd[3029]: (Note ) SYDAlwaysOnAccount: no account (null)
Jan 16 09:57:44 XXXXXXsyncdefaultsd[3029]: (Note ) SYDAccount: no account
Jan 16 09:57:44 XXXXXXsyncdefaultsd[3029]: (Note ) SYDPIMAccount: no account (null)
Jan 16 09:57:44 XXXXXXcalaccessd[3023]: table drop: 101
Jan 16 09:57:48 XXXXXX assertiond[2990]: assertion failed: 14B25 12D5452a: assertiond + 13633 [56E02503-728C-3BA0-86C6-A974ADEB4D32]: 0x1
Jan 16 09:57:49 XXXXXX myapp WatchKit App[3031]: assertion failed: 14B25 12D5452a: libxpc.dylib + 59313 [80CD8E1A-17A4-3A19-9002-555BEFF8E0DF]: 0x7d
Jan 16 09:57:49 XXXXXX assertiond[2990]: assertion failed: 14B25 12D5452a: assertiond + 13633 [56E02503-728C-3BA0-86C6-A974ADEB4D32]: 0x1
Jan 16 09:57:49 --- last message repeated 1 time ---
Jan 16 09:57:49 XXXXXXpkd[3002]: assigning plug-in com.myapp.myapp.watchkitextension(1.0) to plugin sandbox
Jan 16 09:57:49 XXXXXXpkd[3002]: enabling pid=2984 for plug-in com.myapp.myapp.watchkitextension(1.0) A778B88E-CA51-4D10-AB65-5232162DAACF /Users/someuser/Library/Developer/CoreSimulator/Devices/8F26A917-B953-4545-924F-2D29FD00DD2F/data/Containers/Bundle/Application/9042C16E-1E59-4753-8669-3A0F9C3AA0A3/myapp.app/PlugIns/myapp WatchKit Extension.appex
Jan 16 09:57:49 XXXXXX com.apple.CoreSimulator.SimDevice.8F26A917-B953-4545-924F-2D29FD00DD2F.launchd_sim[2973] (com.myapp.myapp.watchkitextension): The _SandboxProfile key is not available on this platform.
Jan 16 09:57:49 XXXXXXSpringBoard[2986]: [MPUSystemMediaControls] Updating supported commands for now playing application.
Jan 16 09:57:49 XXXXXX com.apple.CoreSimulator.SimDevice.8F26A917-B953-4545-924F-2D29FD00DD2F.launchd_sim[2973] (com.myapp.myapp.watchkitextension): The _OmitSandboxParameters key is not available on this platform.
Jan 16 09:57:49 XXXXXX com.apple.CoreSimulator.SimDevice.8F26A917-B953-4545-924F-2D29FD00DD2F.launchd_sim[2973] (com.apple.imfoundation.IMRemoteURLConnectionAgent): The _DirtyJetsamMemoryLimit key is not available on this platform.
Jan 16 09:57:50 XXXXXXbackboardd[2987]: CoreAnimation: timed out fence e025
Jan 16 09:58:00 XXXXXXScriptAgent[3032]: Warning - Unable to stop script because the script was already stopped.
Jan 16 09:58:00 XXXXXXSpringBoard[2986]: Unable to get short BSD proc info for 3031: No such process
Jan 16 09:58:00 XXXXXX com.apple.CoreSimulator.SimDevice.8F26A917-B953-4545-924F-2D29FD00DD2F.launchd_sim[2973] (UIKitApplication:com.myapp.myapp.watchkitapp[0xcea8][3031]): Service exited due to signal: Killed: 9
Jan 16 09:58:00 XXXXXXSpringBoard[2986]: Application 'UIKitApplication:com.myapp.myapp.watchkitapp[0xcea8]' exited abnormally via signal.
Jan 16 09:58:00 XXXXXXassertiond[2990]: notify_suspend_pid() failed with error 7
Jan 16 09:58:00 XXXXXX assertiond[2990]: assertion failed: 14B25 12D5452a: assertiond + 13633 [56E02503-728C-3BA0-86C6-A974ADEB4D32]: 0x1
Jan 16 09:58:00 --- last message repeated 1 time ---
Jan 16 09:58:00 XXXXXXDTMobileIS[2996]: Could not create service named com.apple.instruments.server.services.processcontrol.posixspawn
Jan 16 09:58:00 XXXXXXDTMobileIS[2996]: Could not create service named com.apple.instruments.server.services.launchdaemon
Jan 16 09:58:05 XXXXXXlsd[3000]: LaunchServices: Currently 0 installed placeholders: (
)
Jan 16 09:58:18 XXXXXXmstreamd[2978]: (Note ) PS: Media stream daemon stopping.
Jan 16 09:58:18 XXXXXXmstreamd[2978]: (Note ) AS: <MSIOSAlbumSharingDaemon: 0x7ff1a3f0f020>: Shared Streams daemon has shut down.
Jan 16 09:58:18 XXXXXXmstreamd[2978]: (Warn ) mstreamd: mstreamd shutting down.