【问题标题】:Xcode Build Server failed. The devices configured for testing were not foundXcode 构建服务器失败。未找到配置用于测试的设备
【发布时间】:2017-09-25 04:59:22
【问题描述】:

我们的 Xcode Build Server 失败并且不再执行任何测试。 版本 8.3 (8e162)

声明失败了:

构建服务问题

错误未找到配置用于测试的设备。

当我选择“修复它”时,它会被简单地重定向到机器人设置中的“编辑机器人”->“设备”。有时,iOS 设备列表现在的加载时间(约 15 秒)比以前(立即)要长。

所以,当设备最终出现(如果它们甚至出现)并被选中时,会出现以下错误提示: 内部错误正在更新机器人,请尝试重新配置机器人

这里提供的解决方案对我来说没有问题,因为我在机器人上登录: xcode bots edit failed

有没有人发现

  1. 一个原因,为什么这个错误接缝突然发生
  2. 解决方案?不幸的是,降级到较旧的 xCode 版本对我来说是没有选择的,这里建议:https://forums.developer.apple.com/thread/76453 因为我已经得到了用户降级到的版本。

共享方案或某事突然出现问题或配置错误可能导致问题?

在我再次创建机器人之前,我真的很想修复机器人,以保留构建历史等。

【问题讨论】:

  • 我对以下版本有同样的问题:macOS server: 5.3 (16S4123), Xcode: 8.3.2 (8E2002)
  • @TestAutomator 我提供了一个指向 forums.developer.apple.com 的链接,其中有人在从 8.3 升级到 8.3.2 时遇到了问题 - 潜在的降级是否可以至少为您解决问题?
  • 不幸的是,我的 MacMini 也有硬件问题,这可能是问题的根源。

标签: xcode xcode8 xcode-bots


【解决方案1】:

在github上找到用户@juce提供的解决方案。 Link to original response in Apple Developer Forum

Here' is a link to github post explained a details by @juke

脚本副本:

--- deviceClass.js  2017-05-05 07:10:40.000000000 -0700
+++ deviceClass.js.NEW  2017-05-05 07:13:36.000000000 -0700
@@ -12,6 +12,7 @@
     dbCoreClass = require('./dbCoreClass.js'),
     xcsutil = require('../util/xcsutil.js'),
     logger = require('../util/logger.js'),
+    fs = require('fs'),
     redisClass = require('./redisClass.js');

 /* XCSDeviceClass object */
@@ -141,12 +142,11 @@
         query.endkey = [unitTestUUID, {}];
     }

-    redisClass.getDynamicQuery(req, doc_type, function DEVListRedisGetDynamicQuery(err, docs) {
-        if (err) {
-            opFailed(err);
-        } else if (docs) {
+    var devicesFile = '/Library/Developer/XcodeServer/Logs/xcs_devices.json';
+    fs.readFile(devicesFile, 'utf8', function (err,docs) {
+        if (docs) {
             docs = JSON.parse(docs);
-            log.info('Found', docs.length, 'devices in Redis.');
+            log.info('Found', docs.length, 'devices in file-system cache.');
             opSucceeded(docs);
         } else {
             log.debug('No devices found in Redis. Falling back to CouchDB.');
@@ -167,9 +167,12 @@
                 } else {
                     log.info('Found', docs.length, 'devices in CouchDB.');

-                    redisClass.setDynamicQuery(req, doc_type, JSON.stringify(docs), function DEVListRedisSetDynamicQuery(err, wasSaved) {
-                        if (wasSaved) {
-                            log.debug('Successfully cached devices to Redis.');
+                    fs.writeFile(devicesFile, JSON.stringify(docs), 'utf8', function(err) {
+                        if (err) {
+                            log.debug('Problem saving devices into ' + devicesFile);
+                        }
+                        else {
+                            log.debug('Successfully cached devices to file.');
                         }
                         // Even if there's an error (i.e. Redis suddenly went down), we can still continue since
                         // the next request would be redirected to CouchDB.

如何申请。下载或复制此脚本,并将现有文件路径如下:

[sudo] cd /Library/Developer/XcodeServer/CurrentXcodeSymlink/Contents/Developer/usr/share/xcs/xcsd/classes
    patch deviceClass.js /path/to/xcs-tweaks/xcs-devices-patch.diff

然后重新启动模拟器并可能重新启动您的机器(这是我的情况)。然后检查它是否通过以下方式工作: sudo xcrun xcscontrol --list-simulators

非常感谢@juke,无论你是谁 :)

【讨论】:

  • 像魅力一样工作。谢谢
【解决方案2】:

我的问题是我在早期版本的 Xcode 上设置了机器人(仅安装了 11.2 模拟器)。

我在用于运行机器人的机器上升级了 Xcode 的版本,该机器只安装了 11.4 模拟器。将模拟器更改为这些最新版本即可解决此问题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-02-27
    • 1970-01-01
    • 2016-08-03
    • 1970-01-01
    • 1970-01-01
    • 2021-10-26
    • 1970-01-01
    相关资源
    最近更新 更多