利用x code BOT IPA创建不能为APNS运行,但如果运行内置手动通过X code本身或内置通过X code存档 [英] IPA created via Xcode bot fails to run for APNS but runs if built manually via Xcode itself or built as an archive by Xcode

查看:171
本文介绍了利用x code BOT IPA创建不能为APNS运行,但如果运行内置手动通过X code本身或内置通过X code存档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个CI构建机器运行X code服务器并使用一个机器人来生成一个构建,但是通过BOT建成的.ipa没有被有权为APNS标记注册。

I have a CI build machine running Xcode server and using a bot to generate a build, however the .ipa built via the bot is not being entitled to register for the APNS token.

具体来说,didFailToRegisterForRemoteNotificationsWithError被调用并没有找到的应用没有有效的APS-环境的权利字符串的运行时警告。

Specifically, didFailToRegisterForRemoteNotificationsWithError gets called and there is a runtime warning of ""No valid 'aps-environment' entitlement string found for application".

但是,如果我建一个separte开发PC上的应用程序,或者我真正建立它CI机器上的独立机器人,那么一切都很好。

However if I build the app on a separte development PC, or I build it actually on the CI machine independently of the bot then everything is fine.

我使用推送通知在广泛几个应用程序,以便知道,如果应用程序尚未与正确的配置文件签署总是找到的应用没有有效的APS-环境的权利字符串出现的消息。但是我绝对100%证实,机器人构建的一部分运行,当我手动建立它当应用程序正在建设具有相同的配置文件。

I've used push notifications extensively in several apps so know that the message "No valid 'aps-environment' entitlement string found for application" always appears if the app has not been signed with the correct profiles. However I have absolutely 100% confirmed that the app is being built with the same profiles when running as part of the bot build to when I build it manually.

我也知道X code下载僵尸下运行,用户在运行时,当预置描述文件到不同的位置,我也知道,机器人运行的系统,并在用户没有登录时,我手工打造。我已经采取了所有这些差异考虑在内,但我仍然无法得到BOT建设工作。

I also know that Xcode downloads provisioning profiles to different locations when running under the bot to when running for a user, and I also know that the bot runs as system and not the logged in user when I build manually. I have taken all these differences into consideration but am still unable to get the bot build to work.

更重要的是我已经使用这个相同的CI机器previously生成使用詹金斯(也跑了作为系统),用于推启用,它的工作!

What's more I have used this exact same CI machine to previously build this app using Jenkins (which also ran as system) enabled for push and it worked!

这是我做了什么/检查:

These is what I have done/checked:

1)
手动将项目下载到桌面,在X code打开并检查签名的身份和在构建设置被起诉预置描述文件。建立和利用X code手动运行 - >它的工作原理
通过BOT间接下载该项目作为其集成运行的一部分。打开由博特X $ C $Ç下载的项目(X code服务器下载它:/库/服务器/ X code /数据/ BotRuns //缓存/ NNNN)。做同样的事情,检查签名的身份和资源调配的配置文件。他们使用的那些相同,当我建立在桌面上。

1) Download the project manually to the desktop, open in Xcode and examine the signing identity and provisioning profiles being sued in the build settings. Build and run it manually using Xcode -> it works Download the project indirectly via the bot as part of its integration run. Open the project downloaded by the Bot in Xcode (the Xcode server downloads it to: /Library/Server/Xcode/Data/BotRuns//Cache/NNNN). Do the same thing, check the signing identity and provisioning profiles. THEY ARE IDENTICAL to those used when I build on the desktop

确定这样的问题是不是由于实际签约的身份差异和使用预置描述文件。

OK so the problem is not due to a difference in the actual signing identity and provisioning profiles being used.

2)当你运行X code手动将其下载资源调配配置文件的位置X,但博特下载资源调配配置文件的位置Y.所以我已经研究过X和Y的内容,以确保没有任何选自Y缺失(如果有构建实际上却失败,这事实并非如此)。

2) When you run Xcode manually it downloads the provisioning profiles to location X, but the Bot downloads the provisioning profiles to location Y. So I have examined the contents of X and Y to make sure there is nothing missing from Y (if there was the build would actually fail however, which it doesn't).

要绝对确保它们是相同的我抄X的全部内容复制到Y和再次运行BOT(他们不要被僵尸重写) - 因此,现在的机器人和桌面版本是使用完全相同的的配置文件副本,但仍是有区别的.ipa执行时。

To make absolutely sure they are identical I have copied the entire contents of X into Y and run the bot again (they don't get overriden by the bot) - So now the bot and the desktop builds are using the exact same copies of the profiles yet still there is a difference when the .ipa executes.

顺便X的位置是〜/图书馆/ MobileDevice /配置配置文件和Y的是/图书馆/服务器/ X code /数据/ ProvisioningProfiles。

Incidentally the location of X is ~/Library/MobileDevice/Provisioning Profiles and that of Y is / Library/Server/Xcode/Data/ProvisioningProfiles.

3)当我手动构建它是作为登录的用户,但是当BOT建设是作为系统。因此,钥匙串中我试图复制一切从用户的钥匙串证书和密钥进入系统钥匙串。是仍然没什么区别,通过构建僵尸创建的.ipa未能正常运行,同时构建利用x code不运行手动创建。

3) When I build manually it is as the logged in user, but when the bot build it is as the system. So within the keychain I have tried copying all the certificates and keys from the user's keychain into the system keychain. Yes still it makes no difference, the .ipa created by the build bot fails to run properly while the build created manually via Xcode does run.

这是推动我疯了,浪费了几天了,我还有什么可错过或可以尝试解决此问题?

This is driving me mad and has wasted days already, what else could I have missed or could try to resolve this?

任何建议或想法?

推荐答案

我已经找到了确切原因,至于原因,我不知道背后的原因,所以我打我的一样接受的答案,因为它至少是一种变通方法,以人谁遇到同样的问题。我很想认为原因是由于机器人系统,它错误地期待那里是一个权利文件中的错误。

I have found the exact cause, as to the reason behind the cause I don't know, thus I'm marking mine as the accepted answer as it is at least a workaround to anybody who encounters the same problem. I'm tempted to think the reason is due to a bug in the bot system which is mistakenly expecting there to be an entitlements file.

我发现,机器人构建失败的原因是因为机器人没有放置APS-环境权利到即使该权利是embedded.mobileprovision内.app文件。但是X code不用其插入到.app文件,如果手动内置或存档建立。

I've discovered that the reason the bot build fails is because the bot is not placing the aps-environment entitlement into the .app file even though that entitlement is within the embedded.mobileprovision. But XCode does insert it into the .app file if built manually or an archive is built.

另外我发现,我可以强制机器人投入必要的授权和相关信息到.app文件,如果我使用Entitlements.plist。

Also I've found that I can force the bot to put the necessary entitlement and associated information into the .app file if I use an Entitlements.plist.

但是,这是利用X code 5 - entitlement.plist文件是过去的事情了,所以没有必要使用一个只是为了迫使机器人的权利放入的.app,因此,为什么我怀疑这可能是一个机器人的bug。

But this is using Xcode 5 - entitlement.plist files are a thing of the past, so it should not be necessary to use one just to force the bot to place the entitlement into the .app, hence why I suspect it might be a bot bug.

这篇关于利用x code BOT IPA创建不能为APNS运行,但如果运行内置手动通过X code本身或内置通过X code存档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆