【问题标题】:Xcode 5.0.1 iOS 7.0.3 Error with instruments command line toolXcode 5.0.1 iOS 7.0.3 仪器命令行工具出错
【发布时间】:2026-01-30 15:35:02
【问题描述】:

尝试使用仪器command line tool 启动UIAutomation 测试时,我一直收到以下错误消息:

2013-10-30 12:08:47.868 ScriptAgent[4687:2e07] CLTilesManagerClient: 初始化,sSharedTilesManagerClient

2013-10-30 12:08:47.869 ScriptAgent[4687:2e07] CLTilesManagerClient: 初始化 2013-10-30 12:08:47.869 ScriptAgent[4687:2e07] CLTilesManagerClient:重新连接,0xa5b0aa0 2013-10-30 12:09:17.989 ScriptAgent[4687:2e07] +[UIAXElement initializeAccessibility]: UIAutomation 从未收到 kAXAccessibilityLoaded。等待 30.02 秒。 2013-10-30 12:09:17.990 ScriptAgent [4687:2e07] AXError: 可以 不会自动注册 pid 状态更改 2013-10-30 12:09:18.008 ScriptAgent[4687:2e07] 无法启用可访问性, kAXErrorServerNotFound 2013-10-30 12:09:18.381 仪器[4633:240f] 自动化仪器遇到异常 在尝试运行脚本时。 UIAScriptAgentSignaledException 2013-10-30 11:09:18 +0000 失败:尝试运行时出错 脚本。

其他人有这个问题吗? 感谢您的帮助。

【问题讨论】:

    标签: ios xcode instruments


    【解决方案1】:

    试试sudo rm /tmp/instruments_sock——这是instruments.js创建的用于与instrument通信的套接字文件。该文件可能由于某种原因不可删除。

    该命令将删除文件。或者尝试更改文件的权限设置。

    【讨论】:

      【解决方案2】:

      我在 Xcode 5.0.1 上也遇到了这个问题,即使从 UI 开始,仪器也无法工作 但是仪器在 Xcode 5.0 上运行良好

      经过一番调查,我发现在仪器启动时,iPhoneSimulator SDK中的scriptAgent崩溃了。

      Process:         ScriptAgent [4297]
      Path:            /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/Developer/usr/bin/ScriptAgent
      Identifier:      ScriptAgent
      Version:         270
      Code Type:       X86 (Native)
      Parent Process:  instruments [4208]
      Responsible:     eclipse [1017]
      User ID:         110125050
      
      Date/Time:       2013-11-11 10:52:49.044 +0800
      OS Version:      Mac OS X 10.9 (13A603)
      Report Version:  11
      Anonymous UUID:  A496DC68-476F-589B-352C-303FA1CD2355
      
      Sleep/Wake UUID: F65E37D7-0AFF-4867-9538-8736C8F0B908
      
      Crashed Thread:  0  Dispatch queue: com.apple.main-thread
      
      Exception Type:  EXC_CRASH (SIGABRT)
      Exception Codes: 0x0000000000000000, 0x0000000000000000
      
      Application Specific Information:
      iPhone Simulator (external launch) , iPhone OS 7.0.3 (unknown/11B508)
      
      
      Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
      0   libsystem_kernel.dylib          0x02e94952 __pthread_kill + 10
      1   libsystem_pthread.dylib         0x02e58167 pthread_kill + 101
      2   libsystem_sim_c.dylib           0x02b6ae12 abort + 127
      3   ScreenReaderCore                0x03db5853 SCRCUncaughtExceptionHandler + 111
      4   CoreFoundation                  0x005f7a1d __handleUncaughtException + 749
      5   libobjc.A.dylib                 0x0224ab5c _objc_terminate() + 100
      6   libc++abi.dylib                 0x02a5bf60 std::__terminate(void (*)()) + 14
      7   libc++abi.dylib                 0x02a5b97d __cxa_throw + 116
      8   libobjc.A.dylib                 0x0224a9cd objc_exception_throw + 323
      9   CoreFoundation                  0x005673bb +[NSException raise:format:] + 139
      10  UIAutomation                    0x00cbdf54 +[UIAXElement initializeAccessibility] +    668
      11  UIAutomation                    0x00cc1361 +[UIAXElement uiaxSystemWideElement] + 37
      12  UIAutomation                    0x00cd76d3 -[UIATarget init] + 317
      13  UIAutomation                    0x00cd758a +[UIATarget localTarget] + 65
      14  ScriptAgent                     0x0000ae25 0x1000 + 40485
      15  ScriptAgent                     0x00005e85 0x1000 + 20101
      16  ScriptAgent                     0x00008887 0x1000 + 30855
      17  libdyld.dylib                   0x02d5e70d start + 1
      

      所以我用 Xcode 5.0 中的那个替换了 iPhoneSimulator7.0.sdk,然后这个问题就解决了。 但我不确定这个替换是否有任何副作用。

      【讨论】: