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

107 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

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
147
23h
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
136
6d
[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: <IDESchemeActionsInvocationRecord: 0x112c21ce0> Method: -saveWithCompletionBlock: Thread: <_NSMainThread: 0x600000e441c0>{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
203
2w
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
243
2w
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
231
4w
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
212
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
199
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
279
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
300
Aug ’24
Do CloudKit subscriptions work from command line tool application?
I am able to fetch CloudKit records from my MacOS command line tool/daemon. However, I would like CloudKit to notify my daemon whenever CKRecords were altered so I would not have to poll periodically. In CloudKit console I see that my app successfully created CloudKit subscription, but the part that confuses me is where in my app do I define callback function that gets called whenever CloudKit attempted to notify my app of CloudKit changes? My first question - do I need to define callback in my implementation of UNUserNotificationCenterDelegate? NSApplicationDelegate? Something else? My second question, would CKSyncEngine work from command line application?
1
0
294
Aug ’24
Is it possible to use CloudKit from "Command Line Tool" application?
In Xcode I have created UI-less application. I tried to add following code: import CloudKit let container = CKContainer.default() And it is failing with: In order to use CloudKit, your process must have a com.apple.developer.icloud-services entitlement. The value of this entitlement must be an array that includes the string "CloudKit" or "CloudKit-Anonymous". If I go to project and select my Command Line Tool target I don't see CloudKit capability that I usually see in UI based applications. So, is it impossible to use CloudKit from Command Line tools?
1
0
366
Jul ’24
How to build projects once?
Hi, I have been tasked with porting our C++ codebase from Windows/Linux to MacOS. Our setup uses Premake to generate platform specific project files. On Windows it creates a Visual Studio solution and project files, on Linux it creates makefiles, and on MacOS it generates an Xcode workspace and project files. Our project hierarchy looks something like this: Solution/Workspace S Project A (shared library) Project B (shared library) Project C (shared library) Projects D to R (About a dozen or so - all shared libraries) Project V (application) Project W (application) Project X (application) Project Y (application) Project Z (application) Projects B and C depend on A. Projects D to R are dependent on some or all of the projects A, B, and C. Each application is dependent on projects A, B, and C, and some of the intermediate projects D to R. (The exact dependencies vary according to the application.) Additionally, some applications can load shared libraries dynamically according to their state/settings. I.e., not all shared library dependencies are known at build time. Initially all building typically happens on the command line. Once our build script has run Premake to generate the project files, it proceeds to build everything. Further builds can happen within Visual Studio/Xcode as part of the normal workflow. However, building must happen on the command line for DevOps CI/Release builds. On Windows, for example, MSBuild lets me build the entire solution for a given configuration (Debug/Release/etc) in a single command. This builds projects A, B, C in order, followed by the intermediate projects (D to R), followed by the applications (V to Z). Each project is built once. Same deal for Linux. Make builds each project in turn according to the dependencies with a single command. Each project is build once. On MacOS, however, xcodebuild doesn't let me just build the entire workspace for a given configuration. I can specify a workspace, but then I have to also specify a scheme. Or I can just specify a specific project. However, when I build a specific project, Xcodebuild always builds all dependencies. So my build script at the moment explicitly builds projects D to R, followed by applications V to Z. This, however, leads to the ridiculous situation of Xcode building projects in the following order: D, C, B, A E, C, A F, C, B, A G, B, A etc... V, F, G, H, C, B, A W, G, I, C, B, A X, K, C, B, A etc... With the obvious effect of our MacOS builds taking 20+ times longer than their Windows/Linux counterparts. So, my main questions are: Is it possible to just build every project in the workspace once? Or if that can't be done, is it possible to not build project dependencies? I.e., can I just build the single project I specify? If neither of those are possible, how can I optimise my builds so that they don't take half a day to complete? I should point out, removing the project dependencies isn't an option. If project A is genuinely out of date, it should be built if I build one of the applications. Xcode should be smart enough to realise that it doesn't need to build everything every time.
3
0
331
Aug ’24
How to get Command Line Tool code to launch SwiftUI App code
For MacOS I wrote a Terminal Command Line Tool to help me do number crunching calculations. No need for UI. This works great as-is, but there are opportunities to make the work more interesting by giving it some graphical representation like a heat map of the data. To that end I want the terminal to launch a SwiftUI code to open a window given an optional command line parameter that would display this visual representation of data in a new window. It would be nice to interact with that window visualization in some ways using SwiftUI. I originally thought it'd just be as easy as creating a SwiftUI View file and then throwing what normally appears under @main into a launch function and then calling the launch function from my main.swift file: import SwiftUI struct SwiftUIView: View { var body: some View { Text("Hello, World!") } } #Preview { SwiftUIView() } func LaunchSwiftUIApp() { //@main struct SwiftUIApp: App { var body: some Scene { WindowGroup { SwiftUIView() } } } } Of course this doesn't work. I've already have the command line code just spit out various png files via command line so looking to make those visualization a little more interactive or readable/organized by coding some SwiftUI stuff around those current visualizations. Anyway. Looking around this doesn't seem to be a thing people normally do. I'm not sure how to setup the Terminal Command Line Tool code that I wrote to optionally launch into SwiftUI code.
1
0
329
Jul ’24
Not able to use devicectl usage to run ui tests
Hello, I have a test bundle in my application and one of the strong request of our project is to run ui tests from command line having just application build. How to run unit tests on .app file that has a test target? What we tried xcrun devicectl device install app --device <device-identifier> <UITestBundle-Runner.app> xcrun devicectl device process launch --device <device-identifier> --start-stopped <com.apptestbundle-Runner.xcrun> It launches and is waiting pid to be attached. In lldb: device select <device-identifier> device process list Seeing process 'UITestBundle-Runner' pid. device process --pid 'pid id' It attaches and I can see 'debugserver' in the pid list, but it does not start testing and I need tests to start and run. Thanks!
0
0
362
Jul ’24
instruments Error using CLI
While running instruments using CLI we are seeing below error: command: xcrun xctrace record --template Leaks --launch application --output recording.trace -e DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib Run issues were detected (trace is still ready to be viewed): [Error] An error occurred trying to capture Leaks data. [Error] Failed to generate memory graph for pid 7828: failed to create a VMUTaskMemoryScanner, probably because the target's libmalloc hasn't been initialized Recording failed with errors. Saving output file... System details: Xcode 15.4 Mac :Intel processors MacOs:14.5
0
0
348
Jul ’24
Error attaching to the pid
Hi 👋 I need assistance in attaching the to the pid in terminal. In lldb mode I am connecting to the pid using device process attach --pid <pid-id> which gives me an error Process 505 stopped * thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP frame #0: 0x00000001d505c808 libsystem_kernel.dylib`mach_msg2_trap + 8 libsystem_kernel.dylib`mach_msg2_trap: -> 0x1d505c808 <+8>: ret Thanks
1
0
496
Jul ’24