我的项目中有 2 个编译错误(在 XCode 中显示)。
但是当我在终端中使用xcodebuild编译项目时,只显示一个编译错误
xxx$xcodebuild -sdk iphoneos -configuration Debug
....
....
[self updateAccountInfo];1
^
1 warning and 1 error generated.
Run Code Online (Sandbox Code Playgroud)
是否可以让 xcodebuild 显示所有编译错误?
在 Xcode 的首选项中,在常规选项卡中,选中“错误后继续构建”选项。在这里问
我需要的是使用 xcodebuild 做同样的事情。
编辑:
经过这几天的思考和研究,我认为xcodebuild不能做到这一点。它与 xcode 不同。当我们使用xcode编译iOS项目时,xcode通过clang编译每个.m。所以xcode有“错误后继续构建”功能
我想使用 Terminal 和 xcodebuild 构建一个模拟器。到目前为止,传递类似“-sdk iphonesimulator9.0”之类的东西是有效的。现在手表扩展正在手表上运行,我收到此错误:
=== BUILD TARGET appName WatchKit Extension OF PROJECT appName WITH CONFIGURATION Debug ===
Check dependencies
target specifies product type 'com.apple.product-type.watchkit2-extension', but there's no such product type for the 'iphonesimulator' platform
Run Code Online (Sandbox Code Playgroud)
您知道如何构建支持 watchOS2 的应用程序的模拟器版本吗?
谢谢!
我正在制作 macOS 单元测试包(服务器软件的集成测试):
xcodebuild -project MyApp.xcodeproj -scheme MyApp.macOS build-for-testing
Run Code Online (Sandbox Code Playgroud)
结果,xcodebuild 生成xctest包MyAppTests.xctest和xctestrun文件MyApp.xctestrun。
现在我可以在 CI 服务器上部署xctest包并执行集成测试(默认情况下针对服务器软件的发布候选版本)。
xcodebuild test-without-building -xctestrun MyApp.xctestrun
Run Code Online (Sandbox Code Playgroud)
现在我想瞄准另一个服务器实例(即来自开发分支)。
为此,我可以提供另一个xctestrun文件MyApp-development.xctestrun,其中包含 key 下的其他设置TestingEnvironmentVariables。
<key>TestingEnvironmentVariables</key>
<dict>
<key>com.myapp.ServerKind</key>
<string>development</string>
...
</dict>
Run Code Online (Sandbox Code Playgroud)
在 CI 服务器上启动:
xcodebuild test-without-building -xctestrun MyApp-development.xctestrun
Run Code Online (Sandbox Code Playgroud)
但维护多个xctestrun文件并不是一个好主意。我想要default xctestrun文件并从命令行覆盖它的设置。
是否可以从命令行传递xctestrun文件中的附加设置(或覆盖现有设置) ?
谢谢你!
在我的构建系统中,我用来xcodebuild构建多个项目。
我想为每个项目配置不同的 Xcode 安装。
我知道sudo xcode-select --switch <path>,但是:
有没有办法指定每个项目使用的构建工具路径?
我在构建(存档)工作区时遇到问题,因为每当我运行
xcodebuild archive -workspace app.xcworkspace/ -scheme app-scheme -configuration Production -derivedDataPath ./build -archivePath ./build/Products/app.xcarchive DEVELOPMENT_TEAM=AAABBBCCCD PROVISIONING_PROFILE_SPECIFIER="prod DistProf" CODE_SIGN_IDENTITY="iPhone Distribution"
我明白了
XXX does not support provisioning profiles. XXX does not support provisioning profiles, but provisioning profile YYY has been manually specified. Set the provisioning profile value to "Automatic" in the build settings editor.
对于每个 Pod。当我省略DEVELOPMENT_TEAM标志时,我得到
Signing for "myAPP" requires a development team. Select a development team in the build settings editor that matches the selected profile "YYY".
所有 pod 都不需要签名。在命令行中指定标志似乎忽略了不同项目的设置。我无法使用自动签名,因为我不是颁发证书的团队的成员,我的计算机上只有证书和配置文件,因此任何快速通道解决方案都不起作用。此外,我无法在项目中设置一次,因为它来自第三方公司,而且我们无法共享我们的个人资料。如何将此项目设置为持续集成链?
xcode continuous-integration code-signing xcodebuild cocoapods
我一直在研究 iOS 应用程序的构建过程。我创建了一个“单视图应用程序”项目并在 Xcode 8.2.1 中构建。当我查看构建报告时,我注意到 Xcode 使用 clang 编译和链接 .m 文件,然后使用 ibtool 编译和链接故事板文件。我想知道 ibtool 在编译和链接过程中实际做了什么。在执行以下编译命令后,会在/Users/Kazu/Library/Developer/Xcode/DerivedData/ObjCHelloWorld-guewhpmwckompbfvsbhizkifcadg/Build/Intermediates/ObjCHelloWorld.build/Debug-iphonesimulator/ObjCHelloWorld.build/Base.lproj/目录中创建 .storyboardc 文件,该文件将在稍后的“链接 Storyboards”阶段使用。.storyboardc文件是一组二进制文件,包括 Info.plist 文件。
ObjCHelloWorld/Base.lproj/LaunchScreen.storyboard
cd /Users/Kazu/Dropbox/ObjCHelloWorld
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
export XCODE_DEVELOPER_USR_PATH=/Applications/Xcode.app/Contents/Developer/usr/bin/..
/Applications/Xcode.app/Contents/Developer/usr/bin/ibtool --errors --warnings --notices --module ObjCHelloWorld --output-partial-info-plist /Users/Kazu/Library/Developer/Xcode/DerivedData/ObjCHelloWorld-guewhpmwckompbfvsbhizkifcadg/Build/Intermediates/ObjCHelloWorld.build/Debug-iphonesimulator/ObjCHelloWorld.build/LaunchScreen-SBPartialInfo.plist --auto-activate-custom-fonts --target-device iphone --target-device ipad --minimum-deployment-target 10.2 --output-format human-readable-text --compilation-directory /Users/Kazu/Library/Developer/Xcode/DerivedData/ObjCHelloWorld-guewhpmwckompbfvsbhizkifcadg/Build/Intermediates/ObjCHelloWorld.build/Debug-iphonesimulator/ObjCHelloWorld.build/Base.lproj /Users/Kazu/Dropbox/ObjCHelloWorld/ObjCHelloWorld/Base.lproj/LaunchScreen.storyboard
Run Code Online (Sandbox Code Playgroud)
在链接阶段,执行以下命令,我不知道 ibtool 在做什么。我所能告诉的是它使用storyboardc在编译阶段生成的文件。
LinkStoryboards
cd /Users/Kazu/Dropbox/ObjCHelloWorld
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
export XCODE_DEVELOPER_USR_PATH=/Applications/Xcode.app/Contents/Developer/usr/bin/..
/Applications/Xcode.app/Contents/Developer/usr/bin/ibtool --errors --warnings --notices --module ObjCHelloWorld --target-device iphone --target-device ipad --minimum-deployment-target 10.2 --output-format human-readable-text --link /Users/Kazu/Library/Developer/Xcode/DerivedData/ObjCHelloWorld-guewhpmwckompbfvsbhizkifcadg/Build/Products/Debug-iphonesimulator/ObjCHelloWorld.app …Run Code Online (Sandbox Code Playgroud) 我可以使用 XCUItest 通过以下命令执行我的项目:
xcodebuild test -workspace Maple.xcworkspace -scheme Maple -configuration Debug -destination 'platform=iOS Simulator,name=iPhone
8,OS=11.4'
Run Code Online (Sandbox Code Playgroud)
该命令运行良好,并且我的所有测试用例都运行。
我想执行单个 .swift 文件。所以我使用了以下命令:
xcodebuild test -workspace Maple.xcworkspace -scheme Maple -configuration Debug -destination 'platform=iOS Simulator,name=iPhone 8,OS=11.4' -only-testing:/Users/amit.jathar/Maple/MapleUITests/DashboardTests.swift
Run Code Online (Sandbox Code Playgroud)
上面的命令抛出以下错误:
命令行中的用户默认值:IDETestRunOnlyIdentifiers = ("Maple/MapleUITests/DashboardTests")
--- xcodebuild:警告:无法在工作区“Maple.xcworkspace”中打开项目文件“/Users/amit.jathar/sdm-maple-ios/MaplePlayground.playground”。
2018-07-12 17:44:55.000 xcodebuild [13879:5394085] [MT] DVTAssertions:/Library/Caches/com.apple.xbs/Sources/IDEFrameworks/IDEFrameworks-14161/IDEFoundation/Execution/Schemes/IDETestSchemeAction 中的断言失败.米:272
详细信息:(anyTestRunSpecification) 不应为零。对象:方法:-testOperationWithSchemeOperationParameters:testManager:withBuildOperation:buildParameters:schemeCommand:actionRecord:testRunSpecifications:deviceAvailableChecker:outError:actionCallbackBlock:线程:{number = 1,name = main}提示:
回溯: 0 -[DVTAssertionHandler handleFailureInMethod:object:fileName:lineNumber:assertionSignature:messageFormat:arguments:] (在 DVTFoundation 中) 1 _DVTAssertionHandler (在 DVTFoundation 中) 2 _DVTAssertionFailureHandler (在 DVTFoundation 中) 3 -[IDETestSchemeAction testOperationWithSchemeOperationParameters:testManager:withBuildOperation:buildParameters :方案命令:actionRecord:testRunSpecifications:deviceAvailableChecker:outError:actionCallbackBlock:] (在 IDEFoundation 中) 4 -[IDEScheme _executionOperationForSchemeOperationParameters:build:onlyBuild:buildParameters:title:buildLog:dontActuallyRunCommands:restorePersistedBuildResults:deviceAvailableChecker:error:actionCallbackBlock:] (在 IDEFoundation …
当我在 Xcode 中重复构建版本时,生成的 dSYM 完全为空,因此调试器无法显示任何内容。
我已经能够用Xcode 11.3.1中的最小项目重现此内容,如下所示:
DEPLOYMENT_POSTPROCESSING将for设置Release为YESBuild ConfigurationReleaseInfo.plist现在, GenerateDSYMFile步骤中的构建日志中有一条警告
warning: no debug symbols in executable (-arch x86_64)
Run Code Online (Sandbox Code Playgroud)
如果运行生成的应用程序,将不会有调试信息(您无法在 Xcode 中设置断点,如果您手动中断堆栈帧将只是___lldb_unnamed_symbol,...)
Xcode 构建过程的相关部分似乎是:
因此,1) 在重复构建中被跳过,因为源(以及目标文件)没有改变。2) 被执行,因为Info.plist已更改,但它对已被先前构建剥离的二进制文件进行操作。因此,dSYM 为空。
看起来 2) 应该只在与 1) 相同的条件下重新运行,但这些依赖项似乎在 Xcode 中是硬连线的......
有什么办法可以解决这个问题吗?
我有多种软件解决方案,其中有一些是基于 iOS 的应用程序。我正在利用这个机会并使用 Gitlab Runners / Docker 实现来查看我的 CI 脚本。我已经把大部分工作转移了,但我还是继续看我的 iOS 应用程序。有没有办法在 docker 容器中运行 xcodebuild?
谢谢
我正在尝试构建一个继承的 React Native 应用程序。
每次我通过 xcodebuild 构建时都会收到以下错误:
fatal error: module map file
'/Users/xcodeclub/Library/Developer/Xcode/DerivedData/appname-fpunvqnzmyqummgfroiwvewvqwdb/Build/Intermediates.noindex/ArchiveIntermediates/appname/BuildProductsPath/Release-iphoneos/WCPhotoManipulator/WCPhotoManipulator.modulemap'
not found
Run Code Online (Sandbox Code Playgroud)
XCode 中的 iOS 版本是:12.0
PodFile 中有以下内容:
platform :ios, '12.0'
Run Code Online (Sandbox Code Playgroud) xcodebuild ×10
xcode ×4
ios ×3
macos ×2
build ×1
build-system ×1
cocoapods ×1
code-signing ×1
compilation ×1
docker ×1
dsym ×1
dsymutil ×1
ibtool ×1
react-native ×1
simulator ×1
storyboard ×1
watchos-2 ×1
xctest ×1
xcuitest ×1