我已将 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 目标。
帮助表示赞赏