xcodebuild:错误:'file'不是工作区文件

时间:2014-05-30 09:19:19

标签: xcode jenkins workspace xctest

没有问题,但现在我在Jenkins CI的工作失败了。我尝试重命名Xcode工作区,如RacingPost.xcworkspace没有变化。尝试删除这个选项,这个工作也失败了。

配置:

XCODEPROJECTDIRECTORY=.
TARGET_BUILD_DIR=${XCODEPROJECTDIRECTORY}/build
XCODEWORKSPACE=RacingPost.xcodeproj
XCODESCHEME=UnitTests
XCODECONFIGURATION=ENTERPRISE-HD
XCODESDK=iphoneos
XCODEARGS="TEST_AFTER_BUILD=YES"
XCODEBUILD_APP_NAME=RacingPost.app
XCODETARGET=UnitTests
XCODEPROJECT=RacingPost.xcodeproj
IPA_PATH=${TARGET_BUILD_DIR}/RacingPost.ipa

xcrun -sdk iphoneos PackageApplication -v "$(${XCTOOL_HOME}/xctool.sh -scheme RacingPost -project   ${XCODEPROJECT} -configuration "${XCODECONFIGURATION}" -sdk  "${XCODESDK}" -showBuildSettings -workspace   ${WORKSPACE}| grep TARGET_BUILD_DIR | cut -d = -f 2 | cut -d . -f 1 | head -1 | sed 's/^[ ^t]*//')/${XCODEBUILD_APP_NAME}" -o "${IPA_PATH}"

输出:

17:33:25 ** BUILD SUCCEEDED ** (58104 ms)
 17:33:27 [RGP-ODC_RacingPost_iPad_staging] $ /bin/bash -xe /var/folders/df/575wx61n4dzdlw_48pgsjwk40000gn/T/hudson6052564280091633098.sh
17:33:27 + cd .
17:33:27 ++ /Users/epadmin/ci-tools/xctool/xctool.sh -scheme RacingPost -project RacingPost.xcodeproj - configuration ENTERPRISE-HD -sdk iphoneos -showBuildSettings -workspace /Users/epadmin/jenkins-slave/workspace/RGP- ODC_RacingPost_iPad_staging
17:33:27 ++ grep TARGET_BUILD_DIR
17:33:27 ++ cut -d = -f 2
17:33:27 ++ cut -d . -f 1
17:33:27 ++ head -1
17:33:27 ++ sed 's/^[ ^t]*//'
17:33:30 xcodebuild: error: '/Users/epadmin/jenkins-slave/workspace/RGP-ODC_RacingPost_iPad_staging' is not a workspace file.
17:33:30 + xcrun -sdk iphoneos PackageApplication -v /RacingPost.app -o ./build/RacingPost.ipa
17:33:30 error: Specified application doesn't exist or isn't a bundle directory : '/RacingPost.app'
17:33:30 Build step 'Execute shell' marked build as failure

节点上的文件夹结构:

epadmin@epclus1macp02:~/jenkins-slave/workspace/RGP-ODC_RacingPost_iPad_staging$ ls

drwxr-xr-x  21 epadmin  staff   714B May 29 10:28 ./
drwxr-xr-x  37 epadmin  staff   1.2K May 29 10:33 ../
drwxr-xr-x   7 epadmin  staff   238B May 29 10:28 .svn/
drwxr-xr-x  10 epadmin  staff   340B Apr 18 09:02 RacingPost/
drwxr-xr-x  10 epadmin  staff   340B May 29 09:27 RacingPost.xcodeproj/
drwxr-xr-x  10 epadmin  staff   340B May  7 09:04 RacingPostUtilApp/
drwxr-xr-x   3 epadmin  staff   102B May 18 02:16 Source/
drwxr-xr-x  75 epadmin  staff   2.5K Apr 16 09:03 UnitTests/
drwxr-xr-x  16 epadmin  staff   544B May 29 09:05 _certs/
drwxr-xr-x   3 epadmin  staff   102B Apr 15 09:03 _doc/
drwxr-xr-x   4 epadmin  staff   136B Apr 15 09:03 _provisioning/
drwxr-xr-x   3 epadmin  staff   102B May 29 10:31 build/
-rw-r--r--   1 epadmin  staff   9.9K May 19 04:39 build.xml

1 个答案:

答案 0 :(得分:2)

请勿使用XCODEWORKSPACE=RacingPost.xcodeproj。您没有工作区文件。您不是从工作区构建的。你正在从项目建设。