Xcode 8.3.2 构建脚本 - 指定的应用程序不存在或不是捆绑目录

Xcode 8.3.2 build script - Specified application doesn't exist or isn't a bundle directory

我对 xcode 构建脚本有疑问,希望你能帮忙。

在较旧的 Xcode 中,此脚本运行良好,但现在升级后 xcode 总是失败。

configuration='Release' provision="haithngn_release.mobileprovision" identity="iPhone Distribution: HAITHNGN (TEAMID)"

sdk="iphoneos"
scheme="Mobile"
configuration=
version=
build=
output="$PWD/build/$scheme.$version.$build.$configuration.ipa"

PLIST_PATH="./Mobile/Platforms/ios/Application/"
PLIST_FILE="Info.plist"

/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString $version" "$PLIST_PATH/$PLIST_FILE"
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $version.$build" "$PLIST_PATH/$PLIST_FILE"

echo "Cleaning up old build..."
rm -Rf "$PWD/build/$configuration-$sdk"

echo "Building $scheme, using $configuration configuration, provisioning = $provision"

xcodebuild -sdk "$sdk" -scheme "$scheme" -configuration "$configuration" clean OBJROOT="$PWD/build" SYMROOT="$PWD/build" ONLY_ACTIVE_ARCH=NO
xcodebuild -sdk "$sdk" -scheme "$scheme" -configuration "$configuration" OBJROOT="$PWD/build" SYMROOT="$PWD/build" ONLY_ACTIVE_ARCH=NO CODE_SIGN_IDENTITY="$identity"
xcodebuild -exportArchive -sdk "$sdk" "$PWD/build/$configuration-$sdk/$scheme.app" "$PWD/build/$configuration-$sdk/$scheme.ipa" "$provision"
cp "$PWD/build/$configuration-$sdk/$scheme.ipa" "$output"

终端日志:

xcodebuild: error: The flag -exportPath is required when specifying -exportArchive. xcodebuild: error: The flag -exportOptionsPlist is required when specifying -exportArchive. xcodebuild: error: The flag -archivePath is required when specifying -exportArchive.

XCode 版本 8.3.2

从 Xcode 8.3 开始,您应该使用 xcodebuild -exportArchive 而不是 xcrun(参见 there) or apparently, just zipping the App works as well (see )。

否则,您可能需要使用 Fastlane Gym