我正在尝试使用 xcodebuild 构建我的应用程序。然而,它在这种环境下失败了,我不明白为什么......
这是我正在运行的命令:
xcodebuild \
build \
-scheme "My Project" \
-derivedDataPath './customFolder' \
-destination 'platform=iOS Simulator,name=iPhone 15 Pro Max,OS=17.4' \
-configuration Release \
CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO
这是我遇到的错误:
2024-04-17T13:26:19.3570770Z ** BUILD FAILED **
2024-04-17T13:26:19.3570910Z
2024-04-17T13:26:19.3570910Z
2024-04-17T13:26:19.3571000Z The following build commands failed:
2024-04-17T13:26:19.3572940Z Copy /Users/runner/Library/Developer/Xcode/DerivedData/My_Project-ayymvkrodrcpfzfpxkejssmcssuc/Build/Products/Release\ Development-iphonesimulator/My\ Project.app/Stripe_StripeUICore.bundle /Users/runner/Library/Developer/Xcode/DerivedData/My_Project-ayymvkrodrcpfzfpxkejssmcssuc/Build/Products/Release\ Development-iphonesimulator/Stripe_StripeUICore.bundle (in target 'My Project' from project 'My Project')
2024-04-17T13:26:19.3576630Z Copy /Users/runner/Library/Developer/Xcode/DerivedData/My_Project-ayymvkrodrcpfzfpxkejssmcssuc/Build/Products/Release\ Development-iphonesimulator/My\ Project.app/Stripe_StripePaymentsUI.bundle /Users/runner/Library/Developer/Xcode/DerivedData/My_Project-ayymvkrodrcpfzfpxkejssmcssuc/Build/Products/Release\ Development-iphonesimulator/Stripe_StripePaymentsUI.bundle (in target 'My Project' from project 'My Project')
2024-04-17T13:26:19.3581230Z Copy /Users/runner/Library/Developer/Xcode/DerivedData/My_Project-ayymvkrodrcpfzfpxkejssmcssuc/Build/Products/Release\ Development-iphonesimulator/My\ Project.app/Stripe_StripePayments.bundle /Users/runner/Library/Developer/Xcode/DerivedData/My_Project-ayymvkrodrcpfzfpxkejssmcssuc/Build/Products/Release\ Development-iphonesimulator/Stripe_StripePayments.bundle (in target 'My Project' from project 'My Project')
2024-04-17T13:26:19.3585070Z Copy /Users/runner/Library/Developer/Xcode/DerivedData/My_Project-ayymvkrodrcpfzfpxkejssmcssuc/Build/Products/Release\ Development-iphonesimulator/My\ Project.app/Stripe_StripePaymentSheet.bundle /Users/runner/Library/Developer/Xcode/DerivedData/My_Project-ayymvkrodrcpfzfpxkejssmcssuc/Build/Products/Release\ Development-iphonesimulator/Stripe_StripePaymentSheet.bundle (in target 'My Project' from project 'My Project')
2024-04-17T13:26:19.3588560Z Copy /Users/runner/Library/Developer/Xcode/DerivedData/My_Project-ayymvkrodrcpfzfpxkejssmcssuc/Build/Products/Release\ Development-iphonesimulator/My\ Project.app/Stripe_StripeCore.bundle /Users/runner/Library/Developer/Xcode/DerivedData/My_Project-ayymvkrodrcpfzfpxkejssmcssuc/Build/Products/Release\ Development-iphonesimulator/Stripe_StripeCore.bundle (in target 'My Project' from project 'My Project')
2024-04-17T13:26:19.3592190Z Copy /Users/runner/Library/Developer/Xcode/DerivedData/My_Project-ayymvkrodrcpfzfpxkejssmcssuc/Build/Products/Release\ Development-iphonesimulator/My\ Project.app/Stripe_StripeCardScan.bundle /Users/runner/Library/Developer/Xcode/DerivedData/My_Project-ayymvkrodrcpfzfpxkejssmcssuc/Build/Products/Release\ Development-iphonesimulator/Stripe_StripeCardScan.bundle (in target 'My Project' from project 'My Project')
2024-04-17T13:26:19.3596380Z Copy /Users/runner/Library/Developer/Xcode/DerivedData/My_Project-ayymvkrodrcpfzfpxkejssmcssuc/Build/Products/Release\ Development-iphonesimulator/My\ Project.app/Stripe_Stripe3DS2.bundle /Users/runner/Library/Developer/Xcode/DerivedData/My_Project-ayymvkrodrcpfzfpxkejssmcssuc/Build/Products/Release\ Development-iphonesimulator/Stripe_Stripe3DS2.bundle (in target 'My Project' from project 'My Project')
2024-04-17T13:26:19.3599820Z Copy /Users/runner/Library/Developer/Xcode/DerivedData/My_Project-ayymvkrodrcpfzfpxkejssmcssuc/Build/Products/Release\ Development-iphonesimulator/My\ Project.app/Stripe_Stripe.bundle /Users/runner/Library/Developer/Xcode/DerivedData/My_Project-ayymvkrodrcpfzfpxkejssmcssuc/Build/Products/Release\ Development-iphonesimulator/Stripe_Stripe.bundle (in target 'My Project' from project 'My Project')
2024-04-17T13:26:19.3603360Z Copy /Users/runner/Library/Developer/Xcode/DerivedData/My_Project-ayymvkrodrcpfzfpxkejssmcssuc/Build/Products/Release\ Development-iphonesimulator/My\ Project.app/Sentry_SentryPrivate.bundle /Users/runner/Library/Developer/Xcode/DerivedData/My_Project-ayymvkrodrcpfzfpxkejssmcssuc/Build/Products/Release\ Development-iphonesimulator/Sentry_SentryPrivate.bundle (in target 'My Project' from project 'My Project')
2024-04-17T13:26:19.3607080Z Copy /Users/runner/Library/Developer/Xcode/DerivedData/My_Project-ayymvkrodrcpfzfpxkejssmcssuc/Build/Products/Release\ Development-iphonesimulator/My\ Project.app/SDWebImage_SDWebImage.bundle /Users/runner/Library/Developer/Xcode/DerivedData/My_Project-ayymvkrodrcpfzfpxkejssmcssuc/Build/Products/Release\ Development-iphonesimulator/SDWebImage_SDWebImage.bundle (in target 'My Project' from project 'My Project')
2024-04-17T13:26:19.3611230Z Copy /Users/runner/Library/Developer/Xcode/DerivedData/My_Project-ayymvkrodrcpfzfpxkejssmcssuc/Build/Products/Release\ Development-iphonesimulator/My\ Project.app/PhoneNumberKit_PhoneNumberKit.bundle /Users/runner/Library/Developer/Xcode/DerivedData/My_Project-ayymvkrodrcpfzfpxkejssmcssuc/Build/Products/Release\ Development-iphonesimulator/PhoneNumberKit_PhoneNumberKit.bundle (in target 'My Project' from project 'My Project')
2024-04-17T13:26:19.3615470Z Copy /Users/runner/Library/Developer/Xcode/DerivedData/My_Project-ayymvkrodrcpfzfpxkejssmcssuc/Build/Products/Release\ Development-iphonesimulator/My\ Project.app/MapboxMaps_MapboxMaps.bundle /Users/runner/Library/Developer/Xcode/DerivedData/My_Project-ayymvkrodrcpfzfpxkejssmcssuc/Build/Products/Release\ Development-iphonesimulator/MapboxMaps_MapboxMaps.bundle (in target 'My Project' from project 'My Project')
2024-04-17T13:26:19.3619380Z Copy /Users/runner/Library/Developer/Xcode/DerivedData/My_Project-ayymvkrodrcpfzfpxkejssmcssuc/Build/Products/Release\ Development-iphonesimulator/My\ Project.app/CodeScanner_CodeScanner.bundle /Users/runner/Library/Developer/Xcode/DerivedData/My_Project-ayymvkrodrcpfzfpxkejssmcssuc/Build/Products/Release\ Development-iphonesimulator/CodeScanner_CodeScanner.bundle (in target 'My Project' from project 'My Project')
2024-04-17T13:26:19.3621770Z (13 failures)
2024-04-17T13:26:19.4045210Z ##[error]Process completed with exit code 65.
我应该更改什么才能使该命令正常工作?
如有任何帮助,我们将不胜感激。
我最初认为问题是使用 SPM 与 xcodebuild
-configuration
参数不兼容,因为偶然发现了本次讨论的公认答案。
但是现在,我意识到在这种情况下重要的是给这个参数一个存在的配置。
就我而言,我的论点是
-configuration Release
。但是,我的项目实际上没有名为 Release 的配置。
我只需转到项目的根目录并输入此命令即可获取可用配置的列表:
xcodebuild -list
打印:
Information about project "My Project":
Targets:
My Project
My Project Tests
MyProject WidgetExtension
Build Configurations:
Debug Development
Debug Production
Release Development
Release Production
If no build configuration is specified and -scheme is not passed then "Release Development" is used.
在此之后我所要做的就是使用这些配置之一编辑我的
-configuration
。
xcodebuild \
build \
-scheme "My Project" \
-derivedDataPath './customFolder' \
-destination 'platform=iOS Simulator,name=iPhone 15 Pro Max,OS=17.4'
-configuration 'Release Development'