Xcode机器人安装链接请求超时
我已经能够让我的Xcode机器人成功集成并创build一个.ipa文件。 我有一个SSL证书安装在我的Xcode服务器,我可以连接到Xcode /机器人url罚款。 当我通过iPad连接到url时,我首先被提示安装一个证书,但是它说没有用红色validation(见附件)
在设备上安assembly置文件后,xcode / bots页面有一个绿色的“安装”button。 一旦我点击“安装”button,它永远不会加载应用程序,几分钟后,我得到一个“无法连接到xx.yy.com”
任何想法可能是什么?
https://github.com/mtjddnr/lab/wiki/Xcode-Integration-Server-OTA—Reverse-Proxy-Nginx
Nginx +反向代理+ OS X服务器[Xcode服务器]
build立
互联网 – > [443]路由器(端口转发) – > [443] Nginx服务器(具有HTTPS证书) – > [443] Mac Mini(OS X服务器,Xcode服务器)
(StartSSL certificate is used)
Xcode服务器使用20300(HTTP),20343(HTTPS)端口
问题
- 进入Xcode Server WEB
- select机器人
- 点击
Install
button - 它会要求安装证书,如果第一次。 安装它并返回到网页。
- 再次点击
Install
button - 警报消息“无法连接到服务器”
OTA如何工作
- 当点击
Install
button时,导航到https://<DOMAIN>/xcode/internal/api/integrations/<UNIQUE ID>/install_product
- 它将状态302返回到新位置:
itms-services://?action=download-manifest&url=https://<DOMAIN>:20343/api/integrations/<UNIQUE ID>/<RECENT Integrated ID>/install_manifest.plist
-
itms-services
URL架构调用iOS设备来运行安装。 - iOS下载
install_manifest.plist
然后根据plist信息,select正确的IPA
URL -
https://<DOMAIN>:20343/api/assets/token/<RECENT Integrated ID>/<UNIQUE ID>-<Bot Name>/<Intergation #>/<Product Name>-<Device Model>.ipa
- 下载并安装
分析
- 在步骤2中,它返回URL
<DOMAIN>:20343
。 端口号20343不被路由器(或防火墙)打开 - 另外path应该是
/xcode/internal/api/integrations/
not/api/integrations/
怎么修
位置: /Library/Developer/XcodeServer/CurrentXcodeSymlink/Contents/Developer/usr/share/xcs/xcsd/
修改constants.js
第25行
XCSProxiedAPIBasePath: '/xcode/api',
到XCSProxiedAPIBasePath: '/xcode/internal/api',
评论classes/fileClass.js
行383
//host = host.split(':')[0] + ':' + k.XCSHTTPSPort; // force traffic over the HTTPS port
修改classes/fileClass.js
行384
var basePath = k.XCSAPIBasePath; // connection is direct to xcsd, always
到var basePath = k.XCSProxiedAPIBasePath; // connection is direct to xcsd, always
var basePath = k.XCSProxiedAPIBasePath; // connection is direct to xcsd, always
重新启动服务器
TL; DR您可以通过发送自己的ota.mobileconfig
文件来解决这个问题 – 请参阅本答案的底部
发生什么事
当您单击“安装”button时,IPA文件不会从https://yourxcode.local下载,而是从https://yourxcode.local下载:20343
在https://yourxcode.local:20343上侦听的服务器实际上与运行在OS X服务器上的Apache服务器不同。 它是一个单独的Node.js应用程序,它是Xcode Server安装程序的一部分。
由于只有苹果公司的人知道这个原因,Node.js应用程序使用自签名证书,而不是您可能已经安装在OS X服务器上的SSL证书。 (我真的不明白他们为什么这样做,这是没有意义的)
因此,为了让自签名证书在您的设备上运行,您的Xcode服务器将为您提供一个无线移动configurationconfiguration文件,其中包含您的此自签名Node.js应用程序的根证书。
这是您第一次点击“安装”button时看到的内容:Safari询问您是否要接受并安装新的证书。
现在,如果安装这个证书失败,看起来iOS仍然将其标记为已安装,即使它没有正确安装。 没有用户界面来撤消这个,或者删除证书,所以没有办法重复上述。
现在,您正在使用的设备不能用于从Xcode服务器下载构build,除非您擦除设备 。 (不是开玩笑)
(我认为以前可以通过iPhoneconfiguration实用程序来重置此信息,但是与iOS8一起停止工作)
解
不用担心,我find了解决办法。
在您的OS X服务器上,有一个名为的文件
/Library/Developer/XcodeServer/ConfigurationProfiles/ota.mobileconfig
通过电子邮件发送给你自己 在Cannot connect to yourxcode.local
错误的iOS设备上,从Mail.app打开此文件作为附件。 您的设备将再次询问您是否要安装此证书。 点击它。 回答是。
回到构build摘要屏幕并再次点击安装。 出于某种原因,它会再次要求您再次接受证书。 单击是并确认。
该应用程序现在将安装在您的设备上。