1

我已将 iOS 项目与 Jenkins 集成。为了运行自动化测试用例,我在 shell 脚本中使用了以下代码。

export DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer/
export CODESIGN_ALLOCATE=`xcode-select -print-path`/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate 


xcodebuild -alltargets clean
xcodebuild -alltargets
xcodebuild -sdk iphonesimulator \
           -project Myapp.xcodeProj \
           -scheme Myapp-cal \
           ONLY_ACTIVE_ARCH=NO \
           CONFIGURATION_BUILD_DIR="$WORKSPACE/build" \
           clean build
cucumber  

自动化测试在 xcode 中运行良好,而 Jenkins 出现以下错误。

无法自动检测 APP_BUNDLE_PATH。您是否为模拟器构建了应用程序?搜索目录:/Users/test/Library/Developer/Xcode/DerivedData/Myapp-fayplezntrxmdqeteknsfkkvtzla/Build/Products 请从 Xcode 构建您的应用您应该构建 -cal 目标。

帮助表示赞赏

4

2 回答 2

4

我相信您需要做的就是APP_BUNDLE_PATH在调用 cucumber 之前将您的脚本导出。

像这样的东西:

export APP_BUNDLE_PATH="${WORKSPACE}/build/Build/Products/Debug-iphonesimulator/Myapp-cal.app"
cucumber

要在野外查看此示例,请参阅 briar-ios-example 存储库。[1]

仅供参考/顺便说一句APP,并且APP_BUNDLE_PATH可以互换。[2]

于 2014-09-30T20:17:54.180 回答
0

删除内容/Library/Developer/Xcode/DerivedData并再次编译为我解决了这个问题。我不想硬编码,APP_BUNDLE_PATH因为我有多个目标。

我的错误信息是Unable to auto detect APP_BUNDLE_PATH.

于 2015-08-19T09:52:54.233 回答