ios aps-环境永远是发展
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/42292363/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
aps-environment is always development
提问by AJ Sanjay
I have created the app id with APNS enabled and I configured both development and production certificate
我创建了启用 APNS 的应用程序 ID,并配置了开发和生产证书
Now when I create entitlements it is always displaying development even If I change the Provisioning profile to iTunes deployment also the entitlements is displayed as development
现在,当我创建权利时,它总是显示开发,即使我将配置文件更改为 iTunes 部署,权利也会显示为开发
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>aps-environment</key>
<string>development</string>
</dict>
</plist>
回答by Shebuka
You can't use production certificate in debug/development. Even if you do it then when you 'Archive' Xcode will automatically set it to production (Apple reference). You can see this when you try to submit your app to iTunes connect for TestFlight/Review or for adHoc deployment.
您不能在调试/开发中使用生产证书。即使您这样做,当您“存档”时,Xcode 也会自动将其设置为生产(Apple 参考)。当您尝试将您的应用程序提交到 iTunes 连接以进行 TestFlight/Review 或临时部署时,您会看到这一点。
Xcode 8:
代码 8:
Xcode 9:
代码 9:
回答by Jacob King
There is a known bug in Xcode whereby manually setting this to 'production' causes Xcode to display an error next to your entitlements config with a 'Fix Issue' button. Clicking this sets it back to 'development' This is notintended functionality. As I said it is a known issue and I believe I filed a radar when I first discovered it.
Xcode 中有一个已知错误,手动将其设置为“生产”会导致 Xcode 在您的权利配置旁边显示错误,并带有“修复问题”按钮。单击它会将其设置回“开发” 这不是预期的功能。正如我所说,这是一个已知问题,我相信我第一次发现它时就提交了雷达。
It has been fixed in Xcode 8.3 beta 2. In the meantime, manually set it to 'production' and then ignore the error Xcode gives you, your project will work just fine.
它已在 Xcode 8.3 beta 2 中修复。同时,手动将其设置为“生产”,然后忽略 Xcode 给您的错误,您的项目将正常运行。
回答by pizzamonster
XCode 10.2:
代码 10.2:
If you change your target to "Generic iOS Device" before Archive it will set the aps-environment variable to production. If you archive with the target set to your device it will archive with the aps-environment variable set to development.
如果您在存档之前将目标更改为“通用 iOS 设备”,它会将 aps-environment 变量设置为生产。如果您将目标设置为您的设备进行存档,它将使用设置为 development 的 aps-environment 变量进行存档。