Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/amazon-web-services/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 在生成阶段删除文件?_Iphone_Objective C_Shell_Xcode4 - Fatal编程技术网

Iphone 在生成阶段删除文件?

Iphone 在生成阶段删除文件?,iphone,objective-c,shell,xcode4,Iphone,Objective C,Shell,Xcode4,是否可以在xcode 4中使用构建阶段删除一个文件,具体取决于它是版本还是开发版本 如果有,有人举个例子吗 我试过: if [ "${CONFIGURATION}" = "Debug" ]; then find "$TARGET_BUILD_DIR" -name '*-live.*' -print0 | xargs -0 rm fi 这将打印CopyStringsFile "build/Debug-iphonesimulator/Blue Sky.app/

是否可以在xcode 4中使用构建阶段删除一个文件,具体取决于它是版本还是开发版本

如果有,有人举个例子吗

我试过:

      if [ "${CONFIGURATION}" = "Debug" ]; then
      find "$TARGET_BUILD_DIR" -name '*-live.*' -print0 | xargs -0 rm
      fi
这将打印CopyStringsFile

 "build/Debug-iphonesimulator/Blue Sky.app/PortalText-live.strings" CDL/PortalText-live.strings
cd "/Users/internet/Desktop/iPhone Template/iPhonePortalTemplate/CDL.Labs"
setenv PATH "/Developer/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
builtin-copyStrings --validate --inputencoding utf-8 --outputencoding binary --outdir "/Users/internet/Desktop/iPhone Template/iPhonePortalTemplate/CDL.Labs/build/Debug-iphonesimulator/Blue Sky.app" -- CDL/PortalText-live.strings

但实际上会从捆绑包中删除文件。

我拥有不同文件的唯一方式是有一个单独的目标,并且只在某些目标中包含某些文件

用一个例子来编辑

好的,我在另一个项目中也做了同样的工作。我们有一个DefaultProperties.plist文件,它包含在目标中

然后,我们有3个副本,未包含在目标中,分别是ProdProperties.plist、TestProperties.plist和UatProperties.plist

我们使用xcodebuild在命令行上为环境构建,因为它是使用自动构建服务器(bambol)构建的

在执行xcodebuild之前,我们将运行以下命令:

cp -vf "./Properties/Environments/${environment}Properties.plist" ./Properties/shared/DefaultProperties.plist
touch Properties/shared/DefaultProperties.plist
将$(环境)传递到脚本中


您可以使用Xcode中的RunScript阶段执行类似的操作。

我之所以拥有两个不同的文件,是因为我调用了一个Web服务,有一个开发版本和一个实时版本,所以我拥有一个backoffice dev/live.xml文件,它处理不同版本的所有URL和其他配置要求我让我的代码在appdelegate.m中选择正确的文件,但是没有必要在其中包含额外的文件,所以我想在构建阶段删除它,这并不重要,所以如果无法完成,那就这样吧。我只是想问一下。