标签: xcrun

在以下位置缺少 xcrun:/Library/Developer/CommandLineTools/usr/bin/xcrun 无法克隆 nvm 存储库

**

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | 猛击

**

当我在 Mac 上运行此代码时出现错误

crun: 错误: 无效的活动开发者路径 (/Library/Developer/CommandLineTools),在以下位置缺少 xcrun:/Library/Developer/CommandLineTools/usr/bin/xcrun 无法克隆 nvm 存储库。请举报这个!

如何解决这个问题?

terminal curl xcrun nvm

9
推荐指数
2
解决办法
3527
查看次数

从终端设置xcode"build setting"?

无论如何我可以在不打开xcode的情况下更改xcode中的设置吗?我有一个自动xcodebuild/xcrun进程,但我需要更改1值:

目标>选择目标>构建设置>代码签名资源规则路径添加:$(SDKROOT)/ResourceRules.plist

我找不到任何文件,我可能会把这行...

xcode xcodebuild xcrun

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

XCTest不链接iOS框架

我正在使用命令行运行iOS模拟器单元测试xctest.首先,我构建目标:

xcodebuild -project "build/MyApp.xcodeproj" -target "MyApp Unit Tests" -configuration "Debug" -sdk "iphonesimulator" build
Run Code Online (Sandbox Code Playgroud)

然后运行xctest测试包:

xcrun xctest "build/build/Debug-iphonesimulator/MyApp Unit Tests.xctest"
Run Code Online (Sandbox Code Playgroud)

这工作正常,可以链接/ System/Library/Frameworks中的框架,如安全性.但是xctest一旦我添加了像MobileCoreServices这样的iOS SDK框架,就会中断,给我:

Library not loaded: /System/Library/Frameworks/MobileCoreServices.framework/MobileCoreServices
Run Code Online (Sandbox Code Playgroud)

单元测试在Xcode中运行良好,单元测试目标包含$(PLATFORM_DIR)/Developer/Library/Frameworks在其框架搜索路径中.

有人知道xctest找到iOS框架的正确方法吗?

xcode unit-testing ios xcrun xctest

8
推荐指数
1
解决办法
1153
查看次数

bitcode_strip (xcrun) 有什么作用?

TwilioVideo在我的 iOS 项目中作为 Pods 依赖项添加后,我意识到它的大小显着增加(+100 Mo)。

经过一些研究,我发现了这个线程,尤其是这个消息,它建议通过 Podfile 使用此命令剥离位代码

我对 bitcode 了解不多,直到我发现了这篇关于它的好文章:https ://lowlevelbits.org/bitcode-demystified/

现在我明白什么是位码,为什么 Apple 要求它,以及他们如何使用它来重新编译应用程序(如果他们想要的话)。但是,我仍然不明白这个“strip bitcode”操作是什么,所以我正在寻找有关此的信息(它实际上运行良好,因为在将这些行添加到我的 Podfile 后,我的应用程序现在“仅”大了 30 Mo )。

谢谢你的帮助。

xcode xcrun bitcode

8
推荐指数
1
解决办法
1536
查看次数

xcrun swift在命令行上生成<unknown>:0:错误:无法加载共享库

我的目标是尝试像脚本一样运行我的Swift程序.如果整个程序是自包含的,你可以运行它:

% xcrun swift hello.swift
Run Code Online (Sandbox Code Playgroud)

hello.swift在哪里

import Cocoa
println("hello")
Run Code Online (Sandbox Code Playgroud)

但是,我想超越一步,包括swift模块,我可以导入其他类,函数等.

所以我们假设我们想要在GoodClass.swift中使用一个非常好的类

public class GoodClass {
    public init() {}
    public func sayHello() {
        println("hello")
    }
}
Run Code Online (Sandbox Code Playgroud)

我现在想把这个好东西导入我的hello.swift:

import Cocoa
import GoodClass

let myGoodClass = GoodClass()
myGoodClass.sayHello()
Run Code Online (Sandbox Code Playgroud)

我首先通过运行以下命令生成.o,lib <>.a,.swiftmodule:

% xcrun swiftc -emit-library -emit-object GoodClass.swift -sdk $(xcrun --show-sdk-path --sdk macosx) -module-name GoodClass
% ar rcs libGoodClass.a GoodClass.o
% xcrun swiftc -emit-module GoodClass.swift -sdk $(xcrun --show-sdk-path --sdk macosx) -module-name GoodClass
Run Code Online (Sandbox Code Playgroud)

最后,我准备运行我的hello.swift(好像它是一个脚本):

% xcrun swift -I "./" -L "./" -lGoodClass -sdk $(xcrun --show-sdk-path --sdk …
Run Code Online (Sandbox Code Playgroud)

module xcrun swift

7
推荐指数
1
解决办法
1370
查看次数

在模拟器中安装应用程序时,Simctl安装无法在.app中找到Bundle Identifier

当我尝试在启动的模拟器中安装我的应用程序时,如下所示:

xcrun simctl install booted /build/iphone/build/Debug-iphonesimulator/foo.app
Run Code Online (Sandbox Code Playgroud)

我得到以下结果:

An error was encountered processing the command (code=22):
Failed to install the requested application
The bundle identifier of the application could not be determined.
Ensure that the application's Info.plist contains a value for CFBundleIdentifier.
Run Code Online (Sandbox Code Playgroud)

当我检查.app中的Info.plist时,CFBundleIdentiefier就在那里并且正确.

<key>CFBundleIdentifier</key>
    <string>com.bar.foo</string>
Run Code Online (Sandbox Code Playgroud)

我在Yosemite上使用xcode 6.3.2

模拟器在安装时启动.

我究竟做错了什么?

xcode cfbundleidentifier ios-simulator xcrun simctl

7
推荐指数
1
解决办法
2734
查看次数

Cordova iOS:xcode更新后xcrun找不到"PackageApplication"

今天早上,xcode在我的osx构建设备上更新到8.3版本.

从那时起,当我尝试使用Cordova构建我的iOs应用程序时,我在构建过程结束时收到以下错误:

 [exec] 
 [exec] ** BUILD SUCCEEDED **
 [exec]
 [exec] xcrun: error: unable to find utility "PackageApplication", not a developer tool or in PATH
 [exec] Error: Error code 72 for command: xcrun with args: -sdk,iphoneos,PackageApplication,-v,[source.app]-o,[destination.ipa]
 [exec] Result 1
Run Code Online (Sandbox Code Playgroud)

我似乎无法在我的Cordova或Xcode设置中修复此问题.不知道从哪里开始;)

有没有人遇到过同样的问题?你对解决方案有什么建议吗?

谢谢!

(如果你能救我的话,我会很乐意买一杯啤酒)

xcode building ios cordova xcrun

7
推荐指数
2
解决办法
3897
查看次数

使用 xcrun simctl status_bar 更改或删除 iOS 模拟器上的运营商名称

从 iOS 13 开始,SimulatorStatusMagic不再有效,但很高兴 Apple 通过simctl status_bar.

但是我找不到任何方法来删除或更改“运营商”文本:

iOS 13 状态栏

设置--cellularMode notSupported会删除它,但也会删除蜂窝条。

有什么方法可以重现 SimulatorStatusMagic 以前的功能并仅删除或更改运营商名称?

编辑: Xcode 11.4 包含一个新参数来设置运算符名称,但它似乎不起作用。该文档提供了以下内容:

    --operatorName <string>
         Set the cellular operator/carrier name. Use '' for the empty string.
Run Code Online (Sandbox Code Playgroud)

xcode ios-simulator xcrun

7
推荐指数
1
解决办法
1119
查看次数

VS Code C 错误 - 无效的活动开发人员路径

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

这是我在 VS Code 终端中收到的错误。“#include <stdio.h>”行下有错误曲线。

这是我升级到 Mac OS Monterey 后的情况。

出现这个错误的原因是什么以及解决办法是什么?

c xcrun visual-studio-code

7
推荐指数
1
解决办法
8219
查看次数

DEVELOPER_DIR是否需要在环境中保持设置?

我想并排安装XCode,并使用DEVELOPER_DIR环境变量在它们之间进行选择.这样做的目的是使用结果xcrun -f --sdk macosx clang来确定适当的C编译器,然后在脚本或构建系统中使用它.

CC=$(DEVELOPER_DIR=<something> xcrun -f --sdk macosx clang)

我的问题是DEVELOPER_DIR,在使用找到的工具时是否需要保持设置xcrun,或者是否可以在执行期间设置它xcrun,如上所述,然后在默认环境中使用返回的工具,而不进行DEVELOPER_DIR设置.

换句话说,虽然xcrun显然确实取决于价值DEVELOPER_DIR,但工具本身也依赖于它吗?两者之间有什么有意义的区别:

  • DEVELOPER_DIR=<whatever> command CC=$(xcrun -f --sdk macosx clang)
  • command CC=$(DEVELOPER_DIR=<whatever> xcrun -f --sdk macosx clang)

第二个是正确的吗?还是只有第一个?

macos xcode environment-variables clang xcrun

6
推荐指数
1
解决办法
804
查看次数