标签: xcodebuild

无法从命令行构建XCode项目,但可以从XCode构建

我在XCode中创建了一个简单的基于导航的iPhone应用程序.该应用程序从XCode下构建并正常运行,但我无法从命令行构建它.

从终端我执行:

xcodebuild -project George.xcodeproj -alltargets -parallelizeTargets -configuration Debug build
Run Code Online (Sandbox Code Playgroud)

但我得到了这个错误:

=== BUILD NATIVE TARGET George OF PROJECT George WITH CONFIGURATION Debug ===
Check dependencies
[BEROR]Code Sign error: The identity 'iPhone Developer' doesn't match any valid certificate/private key pair in the default keychain

** BUILD FAILED **


The following build commands failed:
    Check dependencies
(1 failure)
Run Code Online (Sandbox Code Playgroud)

我尝试处理它的方式有问题吗?

iphone xcode objective-c xcodebuild

26
推荐指数
2
解决办法
4万
查看次数

每次构建项目时,如何强制Xcode重建项目中的Info.plist文件?

显然,文件被缓存,因此只有在文件被更改时才会生成.我将环境变量设置为增加我的版本号,等等,并且独立于plist更新它们(实际上在项目构建设置中).是否有一个脚本可以用作脚本构建阶段来强制Info.plist更新?其他一些方便的方式?

xcode xcodebuild

25
推荐指数
5
解决办法
3万
查看次数

使用Xcode的命令行构建工具存档(xcodebuild存档)

构建Xcode项目的命令行工具xcodebuild在Xcode 4中提供了一个新的构建操作:archive.

来自man xcodebuild:

       archive     Archive a scheme from the build root (SYMROOT).  This requires specifying
                   a workspace and scheme.
Run Code Online (Sandbox Code Playgroud)

不幸的是,当我尝试使用它时,我收到一个错误:

$ xcodebuild archive -workspace SimpleTestApp.xcworkspace -scheme SimpleTestApp
xcodebuild: error: Failed to build workspace SimpleTestApp with scheme SimpleTestApp.
    Reason: The selected run destination is not valid for this action.
Run Code Online (Sandbox Code Playgroud)

我的印象是这实际上还没有奏效.有没有人得到它的工作?如果是这样,怎么样?

command-line xcodebuild ios xcode4

23
推荐指数
2
解决办法
2万
查看次数

ld:警告:忽略重复的库:最近更新 Xcodebuild 工具后出现“-lgcc”

最近,我升级到了 Xcode 15,并更新了 xcodebuild 工具。然而,突然之间,我的独立 C++ 应用程序由于某种原因无法使用 g++-13 编译器?任何人都知道什么可能有效,我不想降级到 Xcode 14。

c++ xcode gcc g++ xcodebuild

23
推荐指数
2
解决办法
1万
查看次数

xcodebuild - 如何定义预处理器宏?

如何在使用xcodebuild时定义预处理器宏?

我需要使用一堆不同的配置构建我的应用程序,我想使用shell脚本执行此操作,该脚本使用不同的预处理器宏多次运行xcodebuild.

iphone xcode xcodebuild

22
推荐指数
2
解决办法
2万
查看次数

通过命令行在iphone设备中安装应用程序

我正在使用xcodebuild install -alltargets -iphoneos4.2 -activeconfiguration provisioning_profile=path_of_my_provisioningprofile code_sign_identity=identity.这个命令正在构建我的应用程序,我也正在获取构建文件(.app).但是如何从命令行将应用程序安装到设备中.请帮我解决这个问题.

command-line xcodebuild

22
推荐指数
3
解决办法
3万
查看次数

如何使用xcodebuild构建特定的体系结构?

我有遗留代码依赖于指针,32-bit并希望xCodeBuild用来构建代码command line.由于某种原因,这不起作用.这是我使用的命令:

xcodebuild -configuration Debug -arch i386 
  -workspace MyProject.xcworkspace -scheme MyLib
Run Code Online (Sandbox Code Playgroud)

这是我得到的输出

[BEROR]No architectures to compile for 
  (ONLY_ACTIVE_ARCH=YES, active arch=x86_64, VALID_ARCHS=i386).
Run Code Online (Sandbox Code Playgroud)

显然,它试图建立x86_64的代码,并惨遭失败,因为我只启用i386VALID_ARCHSXcode中的项目设置.

有没有办法让它理解我不想要一个64-bit图书馆?

macos command-line xcodebuild xcode4

21
推荐指数
1
解决办法
3万
查看次数

从命令行运行时,xcodebuild命令提供的结果与从Jenkins运行时的结果不同

我正在使用Jenkins建立CI系统并且发现构建失败了因为xcodebuild报告我执行该行时没有方案

-xcodebuild -workspace XXX -scheme NNN.

我无法弄清楚为什么会发生这种情况,所以为了消除我的工作空间搞砸的东西,我使用XCode创建了一个新的项目模板,发现我对任何xcodebuild命令和任何工作空间/项目的行为都有所不同.

模板项目称为scrap,如果从终端命令行运行此命令,例如:

  xcodebuild -list
Run Code Online (Sandbox Code Playgroud)

它输出

Information about project "scrap":
    Targets:
        scrap

    Build Configurations:
        Debug
        Release

    If no build configuration is specified and -scheme is not passed then "Release" is used.

    Schemes:
        scrap
Run Code Online (Sandbox Code Playgroud)

但是如果我从Jenkins中运行xcodebuild -list,那么输出就是:

Building in workspace /Users/Shared/Jenkins/Home/workspace/scrap
[scrap] $ /bin/sh -xe /var/folders/ph/s6dvlfq9769741g_yzmjlmz000007c/T/hudson3765407964219991487.sh
+ xcodebuild -list
Information about project "scrap":
    Targets:
        scrap

    Build Configurations:
        Debug
        Release

    If no build configuration is specified and -scheme is not passed then "Release" is used.

    This project contains …
Run Code Online (Sandbox Code Playgroud)

xcode xcodebuild jenkins

21
推荐指数
1
解决办法
7158
查看次数

我该如何修复此警告:CoreSimulator正在尝试卸载过时的CoreSimulatorService作业

我在teamcity的构建日志中有一个警告.我已经将我的CI-Server上的Xcode从7.3.1更新到8.步骤成功运行但我有:

[Step 3/3] Starting: /Users/teamcity/local/teamcity-build-agent/temp/agentTmp/custom_scriptxxxxxxx
[Step 3/3] in directory: /Users/teamcity/local/teamcity-build-agent/work/yyyy
[Step 3/3] 2016-10-11 09:04:41.706 xcodebuild[18180:5010256] CoreSimulator is attempting to unload a stale CoreSimulatorService job.  Detected Xcode.app relocation or CoreSimulatorService version change.  Framework path (/Applications/Xcodes/Xcode_8.0.app/Contents/Developer/Library/PrivateFrameworks/CoreSimulator.framework) and version (303.8) does not match existing job path (/Applications/Xcodes/Xcode-7.3.1.app/Contents/Developer/Library/PrivateFrameworks/CoreSimulator.framework/Versions/A/XPCServices/com.apple.CoreSimulator.CoreSimulatorService.xpc) and version (209.19).
[Step 3/3] 2016-10-11 09:04:41.961 xcodebuild[18180:5010256] Failed to locate a valid instance of CoreSimulatorService in the bootstrap.  Adding it now.
Run Code Online (Sandbox Code Playgroud)

我该如何修复此警告?

teamcity continuous-integration xcodebuild xcode8

21
推荐指数
1
解决办法
6978
查看次数

从命令行添加 Xcode 开发者帐户

我正在尝试xcodebuild -allowProvisioningUpdates在我只能通过命令行访问的机器上使用(Azure Devops macOS 托管机器)。

不幸的是,根据man xcodebuild为了使用-allowProvisioningUpdates似乎“需要在 Xcode 的帐户首选项窗格中添加开发者帐户”。

给出这个,有没有办法通过命令行添加帐户?

谢谢你,科斯敏

command-line xcodebuild ios provisioning-profile

21
推荐指数
0
解决办法
1938
查看次数