Command Line Tools

RSS for tag

Command line tools allow for easy installation of open source software or development on UNIX within Terminal.

Posts under Command Line Tools tag

99 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

How to use a lower version macos SDK?
My macos update automatically and the new macos SDK are not fit for my program, so how to use a lower version macos SDK? And I have another problem, once I installed Xcode, the SDK will be set path to Xcode path, also I have a command line path which is /Library/Developer/CommandlineTools. In this path, there is also a SDKs directory which contains some different versions of macos SDK? How to set a default SDK path?
2
0
92
6d
Re: "Unknown Apple ID" entries in Xcode Accounts settings
Hello! This post is a response to another post from Oct 17 that has already been locked for some reason: https://forums.developer.apple.com/forums/thread/766500 After upgrading to Xcode 16.0, our build machine was no longer able to archive and upload builds to App Store Connect automatically, as every single time it would say: `IDEDistribution: Failed to log in with account "(null)" while checking for an App Store Connect account` I tried using the workaround in the post above as suggested, but it does not help the problem. Removing and signing out of the account just results in Xcode not being able to do automatic signing because it no longer has access to the account with privileges to do that automatic signing. error: exportArchive No Accounts error: exportArchive No signing certificate "iOS Distribution" found I also tried Xcode 16.1 beta 3 as suggested and now the build machine's account is actually removed after every build via our build system! I have to log on after every build, log back in, and then upload the build to App Store Connect manually. I'm guessing that this "workaround" was added to Xcode itself, which is not serving its intended purpose and has actually made things worse. Not sure if there is a more official venue to send a bug report, but I'm posting here for help since that's where I originally found the post and it appeared to be written by an Apple engineer. Any other possible workarounds? Should I try one of the newer beta releases? Any help would be appreciated as this is becoming very cumbersome and a routine update of Xcode on our build machine has caused a ton of headaches.
4
0
210
1w
xcodebuild is very slow unless you set CODE_SIGNING_ALLOWED=NO"
Incremental builds using xcodebuild are very slow, around 3x slower when compared to the same build using Xcode. Recently, I discovered that CODE_SIGNING_ALLOWED=NO" fixed the issue, but of course, I can't then run iOS app. It seems like automatic signing using xcodebuild is somehow broken. Therefore, I think I could set CODE_SIGNING_ALLOWED=NO" and sign it manually later. However, I'm not sure how to do that. I checked what Xcode does and it's: /usr/bin/codesign --force --sign - --entitlements /Users/wkulik/Library/Developer/Xcode/DerivedData/XYZ-hblnhsksxjrctzekqmlevcflnsji/Build/Intermediates.noindex/XYZ.build/Debug-iphonesimulator/XYZ.build/XYZ.app.xcent --timestamp\=none --generate-entitlement-der /Users/wkulik/Library/Developer/Xcode/DerivedData/XYZ-hblnhsksxjrctzekqmlevcflnsji/Build/Products/Debug-iphonesimulator/XYZ.app However, if I run xcodebuild with disabled signing I don't have XYZ.app.xcent required by this command. I also tried: codesign --force --deep --sign "Apple Development: John Snow (XYZ)" /Users/wkulik/Library/Developer/Xcode/DerivedData/XYZ-hblnhsksxjrctzekqmlevcflnsji/Build/Products/Debug-iphonesimulator/XYZ.app but the app immediately terminates (the same way like when unsigned). Could anyone help with that?
1
0
268
2w
Resolving "Unknown Apple ID" entries in Xcode Accounts settings
In Xcode 16, if you use automatic signing to build your app from the command line, you may run into a bug where Xcode repeatedly attempts and fails to migrate invalid developer account credentials. The Accounts settings in Xcode displays an "Unknown Apple ID" entry for each failed attempt. The xcodebuild command logs a message similar to the following text: IDEDistribution: Failed to log in with account "(null)" while checking for an App Store Connect account (Error Domain=DVTServicesAccountBasedSessionErrorDomain Code=0 "Unable to log in with account ''." UserInfo={NSLocalizedFailureReason=Unable to log in with account ''., NSLocalizedRecoverySuggestion=The login details for account '' were rejected., DVTDeveloperAccountErrorAccount=<DVTAppleIDBasedDeveloperAccount: 0x600002390b40; username=''>, NSUnderlyingError=0x6000035617d0 {Error Domain=DVTPortalServiceErrorDomain Code=1100 "Your session has expired. Please log in." The issue is resolved in Xcode 16.1. If you use Xcode 16, you can workaround this issue by running the following command in Terminal: defaults delete com.apple.dt.Xcode DVTDeveloperAccountManagerAppleIDLists The command removes and signs you out of all your developer accounts on the system.
0
0
205
1w
CommandLineTools
Install CommandLineTools below macOS Sequoia installs the VULNERABLE version of Git, 2.39.3 while macOS Sequoia installs a non-vulnerable version 2.39.5. How to get the non vulnerable version installed on macOS Sonoma? CVE-2024-32002 - Prior to versions 2.45.1, 2.44.1, 2.43.4, 2.42.2, 2.41.1, 2.40.2, and 2.39.4, repositories with submodules can be crafted in a way that exploits a bug in Git whereby it can be fooled into writing files not into the submodule's worktree but into a .git/ directory.
1
0
143
3w
eslogger man page strange reference
In the man page for the eslogger tool, there is a reference to the jq tool. Postprocess the output in a shell pipeline with jq: % sudo eslogger exec | jq -r 'select(.process.executable.path == "/bin/zsh")|"(.process.audit_token.pid): (.process.executable.path) -(.event.exec.target.executable.path)"' The problem is that the jq tool is not installed by default with macOS. [Q] Isn't the idea that the man page should only reference tools that are part of the standard macOS distribution (or can be downloaded and installed by the OS when you try to run them, like with some developer tools)?
2
0
171
4w
Copy app files using devicectl
Hi, I'm trying to retrieve app icons from an iOS device by using devicectl. Unfortunately, the appIcon command was broken when I first tried it, it worked for the last couple of months, but with the new macOS/Xcode, it is no longer working. Reference: https://developer.apple.com/forums/thread/738793 As a result, I'm now looking for alternative ways to fetch and app icon. When retrieving a list of apps using devicectl, the app file location is returned, e.g. /private/var/containers/Bundle/Application/57ABEEB5-D488-4215-8C9B-8951BA401B33/WhatsApp.app for WhatsApp on my iPhone. The .app file contains the app icon and therefore I'm wondering if it's possible to copy this file to my Mac. xcrun devicectl device info files -h mentions file options: FILE OPTIONS: --username <username> The username of the user we should target. Only relevant for certain domains. --domain-type <domain-type> The file service domain. Valid values are: temporary, appDataContainer, appGroupDataContainer, systemCrashLogs. You must specify a valid domain and identifier pair. Certain domains must be accompanied by an identifier that provides additional context. For example, if the domain is an app data container, the identifier is the bundle ID of the app. For temporary directories, the identifier is a unique client-provided string which is used to get your own space, separate from those of other clients. --domain-identifier <domain-identifier> A unique string used to provide additional context to the domain. The domain types are: temporary: for temporary directories, only to get your own space appDataContainer: container identified by app identifier appGroupDataContainer: container identified by app group identifier systemCrashLogs: crash logs The .app file is located in the /private/var/containers/Bundle/Application directory. The available domain types do not seem to include a way to access this file? Is there a way to copy .app files using devicectl? How can I effectively use the .app paths returned by the apps command?
1
0
213
Oct ’24
rvictl creates Link local connection.
When using rvictl, I notice that it creates 2 interfaces. One of which establishes a link local connection between the iPhone and the Mac. What is this connection for? Why is it so talkative? and why can I only bring one of the created interfaces down but not the other? When I try to bring down the interfaces with the ifconfig enX down command it stops the DHCP requests and several TCP DUP ACK, but the other interface is persistent and will not stop talking. Can someone explain what type of traffic is being transmitted between the Mac and the iPhone?
1
0
220
Oct ’24
Install command line tools 15 in xcode 16 on Mac OS Sequoia 15.0
I recently upgraded my Mac to Sequoia 15.0 (24A335) so I had to upgrade Xcode & command line tools to 16. I need command line tools 15 also on the mac due to some of the legacy projects depending on it. I want to install command line tools 15 and choose it in the Settings-->Location, but Xcode doesn't display "Command line tools 15" although i download & install from https://developer.apple.com/download/all/
2
0
573
Sep ’24
Xcodebuild linker error - referencing Mac OS SDK for iOS builds.
I'm trying to build an iOS project in command line via xcodebuild. OS: Mac OS 15.1 beta Xcode: Xcode 16 Creating a new iOS project and trying to run xcodebuild results in this error. No other dependencies, no frameworks added. ld: building for 'iOS', but linking in dylib (/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/lib/libobjc.A.tbd) built for 'macOS macCatalyst zippered(macOS/Catalyst)' My initial plan was to do this with a VisionOS project, but for some reason, I'm getting errors like this for both platforms and brand new projects. Any pointers as to what is referencing the MacOS SDK and how I can fix this would be helpful. Complete log: /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk iphoneos -configuration Release -scheme iphonedummy build CODE_SIGNING_ALLOWED=NO -verbose User defaults from command line: IDEPackageSupportUseBuiltinSCM = YES Build settings from command line: CODE_SIGNING_ALLOWED = NO SDKROOT = iphoneos18.0 Prepare packages ComputeTargetDependencyGraph note: Building targets in dependency order note: Target dependency graph (1 target) Target 'iphonedummy' in project 'iphonedummy' (no dependencies) GatherProvisioningInputs CreateBuildDescription // Removed a block for length. ExecuteExternalTool /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -v -E -dM -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS18.0.sdk -x c -c /dev/null // Removed another block for length. Build description signature: dc5e0c08dfce007b98c7bce87acea5fe Build description path: /Users/sravankaruturi/Library/Developer/Xcode/DerivedData/iphonedummy-bwpzemojmpkzehhhkxqtjearnxkl/Build/Intermediates.noindex/XCBuildData/dc5e0c08dfce007b98c7bce87acea5fe.xcbuilddata ClangStatCache /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang-stat-cache /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS18.0.sdk /Users/sravankaruturi/Library/Developer/Xcode/DerivedData/SDKStatCaches.noindex/iphoneos18.0-22A3362-8ec3fe4dca91fa9a941eaa2d5faad0e4.sdkstatcache cd /Users/sravankaruturi/dev/iphonedummy/iphonedummy.xcodeproj /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang-stat-cache /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS18.0.sdk -o /Users/sravankaruturi/Library/Developer/Xcode/DerivedData/SDKStatCaches.noindex/iphoneos18.0-22A3362-8ec3fe4dca91fa9a941eaa2d5faad0e4.sdkstatcache ProcessInfoPlistFile /Users/sravankaruturi/Library/Developer/Xcode/DerivedData/iphonedummy-bwpzemojmpkzehhhkxqtjearnxkl/Build/Products/Release-iphoneos/iphonedummy.app/Info.plist /Users/sravankaruturi/Library/Developer/Xcode/DerivedData/iphonedummy-bwpzemojmpkzehhhkxqtjearnxkl/Build/Intermediates.noindex/iphonedummy.build/Release-iphoneos/iphonedummy.build/empty-iphonedummy.plist (in target 'iphonedummy' from project 'iphonedummy') cd /Users/sravankaruturi/dev/iphonedummy builtin-infoPlistUtility /Users/sravankaruturi/Library/Developer/Xcode/DerivedData/iphonedummy-bwpzemojmpkzehhhkxqtjearnxkl/Build/Intermediates.noindex/iphonedummy.build/Release-iphoneos/iphonedummy.build/empty-iphonedummy.plist -producttype com.apple.product-type.application -genpkginfo /Users/sravankaruturi/Library/Developer/Xcode/DerivedData/iphonedummy-bwpzemojmpkzehhhkxqtjearnxkl/Build/Products/Release-iphoneos/iphonedummy.app/PkgInfo -expandbuildsettings -format binary -platform iphoneos -additionalcontentfile /Users/sravankaruturi/Library/Developer/Xcode/DerivedData/iphonedummy-bwpzemojmpkzehhhkxqtjearnxkl/Build/Intermediates.noindex/iphonedummy.build/Release-iphoneos/iphonedummy.build/assetcatalog_generated_info.plist -requiredArchitecture arm64 -o /Users/sravankaruturi/Library/Developer/Xcode/DerivedData/iphonedummy-bwpzemojmpkzehhhkxqtjearnxkl/Build/Products/Release-iphoneos/iphonedummy.app/Info.plist Ld /Users/sravankaruturi/Library/Developer/Xcode/DerivedData/iphonedummy-bwpzemojmpkzehhhkxqtjearnxkl/Build/Products/Release-iphoneos/iphonedummy.app/iphonedummy normal (in target 'iphonedummy' from project 'iphonedummy') cd /Users/sravankaruturi/dev/iphonedummy /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -Xlinker -reproducible -target arm64-apple-ios18.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS18.0.sdk -Os -L/Users/sravankaruturi/Library/Developer/Xcode/DerivedData/iphonedummy-bwpzemojmpkzehhhkxqtjearnxkl/Build/Intermediates.noindex/EagerLinkingTBDs/Release-iphoneos -L/Users/sravankaruturi/Library/Developer/Xcode/DerivedData/iphonedummy-bwpzemojmpkzehhhkxqtjearnxkl/Build/Products/Release-iphoneos -F/Users/sravankaruturi/Library/Developer/Xcode/DerivedData/iphonedummy-bwpzemojmpkzehhhkxqtjearnxkl/Build/Intermediates.noindex/EagerLinkingTBDs/Release-iphoneos -F/Users/sravankaruturi/Library/Developer/Xcode/DerivedData/iphonedummy-bwpzemojmpkzehhhkxqtjearnxkl/Build/Products/Release-iphoneos -filelist /Users/sravankaruturi/Library/Developer/Xcode/DerivedData/iphonedummy-bwpzemojmpkzehhhkxqtjearnxkl/Build/Intermediates.noindex/iphonedummy.build/Release-iphoneos/iphonedummy.build/Objects-normal/arm64/iphonedummy.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -dead_strip -Xlinker -object_path_lto -Xlinker /Users/sravankaruturi/Library/Developer/Xcode/DerivedData/iphonedummy-bwpzemojmpkzehhhkxqtjearnxkl/Build/Intermediates.noindex/iphonedummy.build/Release-iphoneos/iphonedummy.build/Objects-normal/arm64/iphonedummy_lto.o -fobjc-link-runtime -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos -L/usr/lib/swift -Xlinker -add_ast_path -Xlinker /Users/sravankaruturi/Library/Developer/Xcode/DerivedData/iphonedummy-bwpzemojmpkzehhhkxqtjearnxkl/Build/Intermediates.noindex/iphonedummy.build/Release-iphoneos/iphonedummy.build/Objects-normal/arm64/iphonedummy.swiftmodule -Xlinker -dependency_info -Xlinker /Users/sravankaruturi/Library/Developer/Xcode/DerivedData/iphonedummy-bwpzemojmpkzehhhkxqtjearnxkl/Build/Intermediates.noindex/iphonedummy.build/Release-iphoneos/iphonedummy.build/Objects-normal/arm64/iphonedummy_dependency_info.dat -o /Users/sravankaruturi/Library/Developer/Xcode/DerivedData/iphonedummy-bwpzemojmpkzehhhkxqtjearnxkl/Build/Products/Release-iphoneos/iphonedummy.app/iphonedummy ld: building for 'iOS', but linking in dylib (/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/lib/libobjc.A.tbd) built for 'macOS macCatalyst zippered(macOS/Catalyst)' clang: error: linker command failed with exit code 1 (use -v to see invocation)
1
0
352
Sep ’24
[MT] DVTAssertions: ASSERTION FAILURE in IDEFrameworks/IDEFoundation/ProjectModel/ActionRecords/IDESchemeActionsInvocationRecord.m:458
I am creating a iOS library project using Xcode 15 in objective C lang which has dependency XCTest framework and Objective C run time and having UI test cases which can be use used in various projects. I am able to build and run unit test cases using Xcode fine but when try to run test using command line getting below issue Command env NSUnbufferedIO=YES xcodebuild clean test -workspace EnptyLibrary.xcworkspace -scheme EnptyLibrary -configuration Debug -destination 'platform=iOS Simulator,OS=latest,name=iPhone 15 Pro' -destination 'platform=iOS Simulator,OS=latest,name=iPad Pro (12.9-inch) (6th generation)' -testPlan EnptyLibrary -derivedDataPath build -disable-concurrent-destination-testing -retry-tests-on-failure=NO Error log ** TEST SUCCEEDED ** 2024-09-12 16:36:34.822 xcodebuild[8345:45388802] Writing error result bundle to /var/folders/12/rcxtcvjs08169cc_fzhyc8x40000gq/T/ResultBundle_2024-12-09_16-36-0034.xcresult 2024-09-12 16:36:34.832 xcodebuild[8345:45388802] [MT] DVTAssertions: ASSERTION FAILURE in IDEFrameworks/IDEFoundation/ProjectModel/ActionRecords/IDESchemeActionsInvocationRecord.m:458 Details: Assertion failed: !self.hasSaved Object: &lt;IDESchemeActionsInvocationRecord: 0x112c21ce0&gt; Method: -saveWithCompletionBlock: Thread: &lt;_NSMainThread: 0x600000e441c0&gt;{number = 1, name = main} Hints: Backtrace: 0 -[DVTAssertionHandler handleFailureInMethod:object:fileName:lineNumber:assertionSignature:messageFormat:arguments:] (in DVTFoundation) 1 _DVTAssertionHandler (in DVTFoundation) 2 _DVTAssertionFailureHandler (in DVTFoundation) 3 _DVTAssertionWarningHandler (in DVTFoundation) 4 -[IDESchemeActionsInvocationRecord saveWithCompletionBlock:] (in IDEFoundation) 5 -[IDESchemeActionsInvocationRecord saveSynchronouslyWithError:] (in IDEFoundation) 6 -[Xcode3CommandLineBuildTool saveResultBundleForError:triageWithSchemeTask:error:] (in Xcode3Core) 7 -[Xcode3CommandLineBuildTool _printError:schemeTask:andFailWithCode:] (in Xcode3Core) 8 -[Xcode3CommandLineBuildTool _printErrorWithSchemeTaskUserInfo:] (in Xcode3Core) 9 -[Xcode3CommandLineBuildTool _buildWithTimingSection:] (in Xcode3Core) 10 -[Xcode3CommandLineBuildTool run] (in Xcode3Core) 11 XcodeBuildMain (in libxcodebuildLoader.dylib) 12 -[XcodebuildPreIDEHandler loadXcode3ProjectSupportAndRunXcode3CommandLineBuildToolWithArguments:] (in xcodebuild) 13 -[XcodebuildPreIDEHandler runWithArguments:] (in xcodebuild) 14 main (in xcodebuild) 15 start (in dyld) zsh: abort env NSUnbufferedIO=YES xcodebuild clean test -workspace -scheme EnptyLibrary
0
0
308
Sep ’24
No new release of Xcode command line tools?
The release of Xcode 15.4 included and SDK for macOS 14.5 (release notes). However, there does not seem to be a corresponding release of this SDK in the command line tools (download list). Is there a reason for this? Reinstalling the command line tools does not provide the missing SDK (as expected). The missing SDK is causing problems with compiling our codebase on both macs with intel chips and ARM chips. Will there be an update to the command line tools in accordance with Xcode 15.4?
1
0
376
Sep ’24
Programatically changing the brightness of your Macbook
Hi all, I was wondering if anyone knew a way to change the brightness of your MacBook screen in Swift without using an overlay that changes the colours? I want the effect of just pressing the F1 and F2 brightness controls but done without using system events/ Applescript popping up windows on the screen. I think the UIScreen.brightness is something similar to what I want but it is not available for NSscreen. I can't figure out a way to do it with IOKit either. Things like ddccl doesn't work as the screen is not an external monitor. If there is a solution using Swift or terminal commands any help is much appreciated. Thanks, James
1
0
326
Sep ’24
terminal input buffer size
Hi all. When in terminal I run the command that reads user input from stdin, for example base64 , I can paste or type up to 1024 characters (bytes). After that terminal starts beeping and does not allow me to type or paste anymore input. Where is the terminal input buffer set and how can I increase it? Thank you
2
0
284
Aug ’24
NIOThreadPool segfault
Following the latest Command Line Tools update, the swift-nio library (https://github.com/apple/swift-nio) causes my program to segfault. The function where the error occurs is runIfActive, which is executed with the following error: Thread 12: EXC_BAD_ACCESS (code=1, address=0x4) swift version: swiftlang-6.0.0.7.6 clang-1600.0.24.1 NIO version: 2.70.0
1
0
274
Aug ’24
CLI Workflow: IPA Installation
I have a Mac Catalyst app bundle built from Rust. I am able to execute this bundle from my M2 Mac-Mini. I am wondering how might I go about creating a proper IPA archive in order to install to my iOS/iPadOS devices. I am using the following code to generate and sign the app bundle: cd "${APPDIR}/" /usr/bin/codesign -s "Apple Development: <ID>" -fv ./counter.app cd ./counter.app zip -r ../counter.ipa * I then use cfgutil to try to install to my iPhone that is plugged into my Mac-Mini: cfgutil -v install-app ./counter.ipa I receive the following error when trying to install: Waiting for the device [1/4] [*******************************************] 100% cfgutil: error: Information about an app could not be read. (Domain: ConfigurationUtilityKit.error Code: 404) "install-app" failed on <>'s iPhone (ECID: <>). --- Summary --- Operation "install-app" failed on 1 devices. The contents of the app bundle before signing: counter.app/ - Geneva.ttf - counter - Info.plist Contents of Info.plist: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CFBundleIdentifier</key> <string>com.example.counter</string> <key>CFBundleDisplayName</key> <string>counter</string> <key>CFBundleName</key> <string>counter</string> <key>CFBundleExecutable</key> <string>counter</string> <key>CFBundleVersion</key> <string>0.1.0</string> <key>CFBundleShortVersionString</key> <string>0.1.0</string> <key>CFBundleDevelopmentRegion</key> <string>en_US</string> <key>UILaunchStoryboardName</key> <string></string> <key>LSRequiresIPhoneOS</key> <true/> </dict> </plist> Is there anything I'm doing wrong in signing and/or creating the IPA archive? Or perhaps I am missing something in the bundle itself?
1
0
358
Aug ’24
`rvictl` and iPad Air not working
When I try to use rvictl with an iPad Air, the tool doesn't error out, but also doesn't indicate success. Here are two invocations first with the udid of an iPhone Mini, which succeeds, and second with an iPad Air, which does not: ~/Desktop via 🐦 v6.0 took 3s ❯ rvictl -s 00008110-[snip] Starting device 00008110-[snip] [SUCCEEDED] with interface rvi0 ~/Desktop via 🐦 v6.0 took 5s ❯ rvictl -s 00008112-[snip] ~/Desktop via 🐦 v6.0 took 3s ❯ If I list interfaces I only see rvi0, which corresponds to the iPhone Mini.
1
0
364
Aug ’24