存档期间不存在Xcode环境变量 [英] Xcode Environment Variables Not Present During Archive

查看:129
本文介绍了存档期间不存在Xcode环境变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个具有TestFlight构建方案的iOS应用程序。在这个方案中,我在运行选项卡中设置了一个名为TESTFLIGHT的环境变量,其值为1。此外,在构建方案的配置文件选项卡中,它选中了使用RUn操作的参数和变量选项,并在列表中看到相应的EV。

I have an iOS application that has a TestFlight build scheme. In this scheme I have setup an environment variable called TESTFLIGHT with a value of 1 set in the "Run" tab. Also, in the "Profile" tab of the build scheme it has the "Use the RUn action's arguments and variables" option checked, and I see the appropriate EV in the list.

从Xcode运行应用程序时这很好用,但是当我在我的设备上进行存档并运行应用程序时,环境变量TESTFLIGHT不存在。我的问题是我在这里缺少一个选项/方案选项卡?

This works just fine when running the app from Xcode, but when I make an archive and run the app on my device the Environment Variable TESTFLIGHT is not present. My question is there an option/scheme tab that I'm missing here?

EV在运行选项卡上设置,并被选中用于调试构建配置。我是否需要将其更改为发布?

The EV is set on the "Run" tab and is selected for the debug build configuration. Do I need to change this to release?

谢谢大家!

推荐答案

仅当您从Xcode运行应用程序时才设置环境变量。如果您通过点击图标直接从设备运行相同的应用程序,则不会设置它们。它们不是应用程序的一部分。顾名思义,它们是环境的一部分,Xcode在运行之前就已经专门设置了。 (如果您在Mac上进行开发,可以在启动可执行文件之前将它们设置在shell中,但这在iPhone上是不可能的。)

Environments variable are set only if you run the app from Xcode. If you run the same app from the device directly by tapping the icon, they won't be set. They are not part of the app. As their name imply, they are part of the environment, that Xcode sets up specifically before running them. (If you were developing on the Mac, you could set them in a shell before launching an executable, but that is not possible on the iPhone.)

这篇关于存档期间不存在Xcode环境变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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