在哪里设置应用程序的环境变量? [英] Where to set environment variables for app?

查看:223
本文介绍了在哪里设置应用程序的环境变量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用冻结的源代码,不能更改;但其ENV意识到并预期通过ENV的变化。源代码正在Xcode 4 / iOS项目中使用。



Xcode 3允许我们在可执行文件夹中的应用程序中设置环境变量(参见图1 < a href =http://developer.apple.com/library/ios/#technotes/tn2239/_index.html =nofollow noreferrer> iOS调试魔法)。 Xcode 4似乎缺少Xcode 3中存在的可执行信息。



我在Stack Overflow中查看了一些类似的问题,但没有人回答了问题。答案通常会退化为预处理宏。会议:如何在iPhone可执行文件中设置环境变量使用XCode 4? Xcode中的条件环境变量在ios中设置环境变量的位置?。



如何在Xcode 4中设置应用程序的环境变量?

解决方案

您可以设置环境变量通过Xcode方案。要编辑方案,请在顶部栏中选择它:





选择运行模式并转到参数选项卡,然后进入...





默认情况下,这些设置也用于测试和配置文件模式。


I'm working with source code that is frozen and cannot be changed; but its ENV aware and expects changes through the ENV. The source code is being used in an Xcode 4/iOS project.

Xcode 3 allowed us to set environmental variables on the app in the Executable folder (see Figure 1 at iOS Debugging Magic). Xcode 4 appears to lack the 'executable info' that was present in Xcode 3.

I've looked through a number of similar questions on Stack Overflow, but no one has answered the questions. Answers usually degenerate to preprocessor macros. Confer: How to set environment variables in iPhone executable using XCode 4?, Conditional Environment Variables in Xcode, and Where to set environmental variables in ios?.

How does on set an app's environment variables in Xcode 4?

解决方案

You can set environment variables via Xcode Schemes. To edit a scheme, select it in the top bar:

Choose the Run mode and go to the Arguments tab, and there you go...

By default, these settings are also used for the Test and Profile modes.

这篇关于在哪里设置应用程序的环境变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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