Command Line Tools

RSS for tag

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

Command Line Tools Documentation

Posts under Command Line Tools tag

117 Posts
Sort by:
Post not yet marked as solved
3 Replies
2.1k Views
I was on 14.3 and building my project fine. After upgrading to XCode command line tools 14.3.1 (MacOS SDK 13.3), I'm unable to build my project any more: /Library/Developer/CommandLineTools/usr/bin/make build BUILD_DIR=debug -j 16 cmake --build _build/debug -j 16 ninja: error: '/Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk/usr/lib/libz.tbd', needed by 'project1', missing and no known rule to make it make[1]: *** [build] Error 1 make: *** [debug] Error 2 NOte that the error message shows it's looking for libz.tbd still under the old SDK MacOSX13.1.sdk, while the just installed version is MacOSX13.3.sdk $ ls -lht /Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk/usr/lib/libz.tbd lrwxr-xr-x 1 root wheel 10B Jun 11 21:29 /Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk/usr/lib/libz.tbd -> libz.1.tbd Reinstalling cmake and ninja didn't help. I also tried reverting to the previous veresion by downloading and installing XCode command line tools 14.3, but then even more problems were found that many tools/libs were referring to MacOSX13.3.sdk instead of MacOSX13.1.sdk and reinstalling them didn't help. Can someone help please?
Posted
by
Post not yet marked as solved
8 Replies
868 Views
I'm working on macOS app that includes command-line helper programs and daemons launched by the GUI app. I used to use the same signing ID (codesign -i) for the GUI and CLI binaries but recently switched to different signing IDs after seeing recommendations against it here on the forums. My question is: Why should each program have a different signing ID? What issues could arise if the GUI and CLI (agent/daemon) have the same signing ID? I was shipping them with the same signing ID for months and didn't notice any issues. So far, my experience is that it's only making things more complicated and hurting UX. For example, I have to request notification permissions twice, once for the GUI and once for the CLI. I'm also worried that users might have to to grant TCC permissions multiple times.
Posted
by
Post marked as solved
1 Replies
2.4k Views
One of the supported methods to install the Command Line Tools for Xcode is with the command "xcode-select --install”. I have recently submitted a Feedback (FB12355012) because currently, when using this command on macOS Ventura 13.4 (22F66) and according to System Information application -> "Installations”, version 14.2 is installed even if the latest (non-beta) version is 14.3.1. The answer from Apple has been that the behavior I'm experiencing is currently functioning as intended. However, I think that should be installed version 14.3.1 instead of 14.2 and that the “Command Line Tools for Xcode” line in System Information application -> "Installations" should report version 14.3.1. Am I missing something here? In your opinion, why Apple thinks that is fine to install an old version of the tools?
Posted
by
Post not yet marked as solved
5 Replies
2.5k Views
I am getting the following error while trying to build a project using xcodebuild command line. Please help xcodebuild -workspace "EmptyWidgetWithStoryboard.xcodeproj/project.xcworkspace" -scheme "EmptyWidgetWithStoryboard-Package" -destination "generic/platform=iOS" -configuration "Debug" -derivedDataPath "output/aws" clean GCC_PREPROCESSOR_DEFINITIONS='AWS_UI_TEST COCOAPODS=1 DEBUG=1 RUN_BUILDTIME_SCRIPTS=0 GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1' ENABLE_BITCODE=NO build-for-testing | tee '/Users/ctobuilduser/Library/Logs/fastlane/xcbuild/2023-06-28/73329/xcodebuild.log' | xcpretty --color --simple' was 65 instead of 0. (FastlaneCore::Interface::FastlaneShellError) 2023-06-28 07:10:47.736 xcodebuild[73363:154164520] DVTDownloadable: Unexpected error attempting to parse downloadable from index: Error Domain=DVTDownloadableErrors Code=16 "Unable to read in downloadable data. See underlying errors for details." UserInfo={DownloadablePlist={ authentication = virtual; category = simulator; contentType = diskImage; dictionaryVersion = 2; fileSize = 7354535384; hostRequirements = { minHostVersion = "13.4"; minXcodeVersion = "15.0"; }; identifier = "com.apple.dmg.xrSimulatorSDK1_0_b1"; name = "xrOS 1 beta Simulator Runtime"; platform = "com.apple.platform.xros"; simulatorVersion = { buildUpdate = 21N5165g; version = "1.0"; }; source = "https://download.developer.apple.com/Developer_Tools/visionOS_1_beta/visionOS_1_beta_Simulator_Runtime.dmg"; version = "1.0.0.1"; }, NSLocalizedDescription=Unable to read in downloadable data. See underlying errors for details., DVTUnderlyingErrorsKey=( "Error Domain=DVTDownloadableErrors Code=23 \"'com.apple.platform.xros' is an unknown platform identifier.\" UserInfo={NSLocalizedDescription='com.apple.platform.xros' is an unknown platform identifier.}" )}
Posted
by
Post marked as solved
2 Replies
842 Views
Hi, I'm trying to sign/notarize a command line application packaged as .pkg which accesses USB devices through libusb. When nothing is sign/notarized everything works like a charm and the command line tool can be started without elevated mode (sudo). Once the binary, its libraries, and the .pkg are signed (hardened runtime set) and finally notarized/stappled with success I noticed that, once the .pkg is installed, the bin/libs are owned by root:wheel. Nobody else can execute it. Means sudo is required to execute the tool, which is obviously not what I need to distribute the software to end-users... As far as I understand I must have to configure some entitlements when invoking the codesign command. Am I wrong? If not, before struggling with them I need some advises about which one should I select ? com.apple.security.app-sandbox ? com.apple.security.device.usb ? com.apple.vm.device-access (?) others ? Thanks by advance for your help.
Posted
by
Post not yet marked as solved
0 Replies
620 Views
When I run the Command-lined "brew install libc-msp430 gdb-msp430", I got this error. I have m2 pro MacBook. ==> ../configure --target=msp430 --program-prefix=msp430- --prefix=/opt/homebrew/Cellar/binutils-msp430/2.22-201209 ==> make Last 15 lines from /Users/mdataullah/Library/Logs/Homebrew/binutils-msp430/02.make: && mv BLD-POTFILES-t BLD-POTFILES ) cd .. && CONFIG_FILES=po/Makefile.in:po/Make-in CONFIG_HEADERS= /bin/sh ./config.status config.status: creating po/Makefile.in config.status: executing depfiles commands config.status: executing libtool commands config.status: executing default-1 commands config.status: executing bfd_stdint.h commands config.status: executing default commands make[3]: Nothing to be done for info'. make[3]: Nothing to be done for info-am'. make[2]: *** [info-recursive] Error 1 make[1]: *** [all-bfd] Error 2 make: *** [all] Error 2
Posted
by
Post marked as solved
1 Replies
1.1k Views
Hi, I am trying to install the "Git" command from Terminal but an error message pops up. If there is anyone that could help, that would be greatly appreciated. Also, I am on macOS Sonoma and Xcode 15 Beta 3. "Can't install the software because it is not currently available from the Software Update server."
Posted
by
Post not yet marked as solved
0 Replies
501 Views
Hello, guys! I am stuck in generating IPA using the command-line interface (CLI). I have a scenario where I'm learning to automate the IPA generation by passing the necessary values through the CLI. I have created a separate keychain for this purpose. However, I am facing a situation where even if I pass a specific keychain value in the CLI, it still appears to be looking in the default keychain. I already have the iOS distribution certificate and Apple distribution certificate installed in the Login keychain. I won't delete them because I need them for generating IPA files from Xcode. I want to avoid adding them again and repeating the same steps. iPhone Distribution: “Team_Name” (Team_ID) Apple Distribution: Team_Name” (Team_ID) When I have the above two certificates installed in the login keychain, and I try to build using the 'iPhone Distribution' option, I receive an error stating that the provisioning profile 'Adhov' doesn't include the signing certificate 'Apple Distribution:'. I don't understand why it is pointing to the distribution certificate. My main issue is that even though I have specified to pick the certificates from the custom keychain, when both certificates are installed in the login keychain. I am able to import the certificate into the custom keychain. When I try to codesign using these below commands , it throws an error stating that it doesn't include the signing certificate for the Apple distribution certificate in my iOS distribution profile. Here are the code snippets I am trying to work on. #Unlock the custom keychain security unlock-keychain -p “Password” ~/Library/Keychains/customKeychain.keychain #importing the p12 certificate to custom keychain security import "${16}"."p12" -P ${17} -A -k ~/Library/Keychains/customKeychain.keychain #allow all applications to access this item security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k “password” ~/Library/Keychains/customKeychain.keychain #Check for valid identity security find-identity -v -p codesigning ~/Library/Keychains/customKeychain.keychain #generating the archive file xcodebuild -workspace "$1" -scheme "$2" -configuration Release -archivePath $6/$9."xcarchive" archive #codesigning for the archive file codesign -s ${18} $6/$9."xcarchive" #exporting IPA file xcodebuild -exportArchive -archivePath ${6}/${9}."xcarchive" -exportPath ${6}/${9} -exportOptionsPlist ${8} #delete the certificate after successfull build generation security delete-certificate -c ${18} ~/Library/Keychains/dws.keychain
Posted
by
Post not yet marked as solved
0 Replies
1.2k Views
`shauryajetty@Shauryas-MBP ~ % brew -v install apple/apple/game-porting-toolkit Warning: apple/apple/game-porting-toolkit 1.0.2 is already installed, it's just not linked. To link this version, run: brew link game-porting-toolkit Error: /usr/local/opt/game-porting-toolkit is not a valid keg` how the heck do I fix this?? I am on macOS 14 dev beta 3, and my computer ran out of battery during the install (face palm) but then it stopped and I tried install Game Porting Toolkit and got this. I tried the command but nothing happened.
Posted
by
Post not yet marked as solved
4 Replies
683 Views
I'm dealing with a problem uploading our release binaries that is completely perplexing. If I use the ITMS Transporter desktop app to upload my IPA, everything works fine. If I use the ITMS Transporter command line interface (which i'm calling from inside the desktop app's directory /Applications/Transporter.app/Contents/itms/bin/iTMSTransporter -m upload...) to upload my IPA, I get the following error ERROR ITMS-90529: Invalid package. Applications built with sdk 9.0 or later must be packaged as proper IPA files. No idea why this error is coming up. I can also use altool to upload my binaries successfully. The issue is altool is being deprecated and I need to be able to use the ITMS command line interface as part of some deployment scripts we have. Please help!
Posted
by
Post not yet marked as solved
1 Replies
572 Views
I am trying to create installer package for Mac using productbuild and pkgbuild . while installing everything looks good but .app file is not getting copied to install-location. Commands: /usr/bin/pkgbuild --install-location /Applications/MyAppFolder --identifier com.***.*** --component Content/MyApp.app --scripts Script --version "1.0.1" Build/MyPackage.pkg In the above command, I have copied signed .app file in the content folder all my scripts in scripts folder. I tried using root arg too. While using root, all the other files available in the Content folder are getting copied at the install-location but not the .app file. /usr/bin/pkgbuild --install-location /Applications/MyAppFolder --identifier com.***.*** --root Content --scripts Script --version "1.0.1" Build/MyPackage.pkg I tried using "productbuild" command too but no luck. App file is missing post install. /usr/bin/productbuild --identifier com.***.*** --package Build/MyPackage.pkg Final/MyPackage.pkg
Posted
by
Post not yet marked as solved
0 Replies
741 Views
Hello! I’m currently trying to build my iOS project from the command line including all symbols with dSYMs. Some information about my project: I have two different targets in addition to libraries imported with a mix of Cocoapods and SwiftPM The debug information format for all targets is “DWARF with dSYM File” The issue I’m having is that after dSYM files are created, there is one empty one. The empty one always ends up being the actual app’s dSYM file. So the second target and all dependency dSYM files are created successfully, but the main app dSYM file is completely empty. Strangely, it works properly in about 1 out of every 20 builds. I’m building the app with the following command: 
 xcodebuild clean archive -workspace $WORKSPACE/workspaceName -scheme “appName-$ENV" -archivePath $WORKSPACE/build/xcarchive name -destination 'generic/platform=iOS' || exit 1 I run the build command from a build server that uses Jenkins. When I run this locally, or build from Xcode, this problem does not occur. It seems to be isolated to only the build server. Xcode version: 14.3 MacOS version: 13.3.1 Any suggestions on why this might be happening?
Posted
by
Post not yet marked as solved
0 Replies
657 Views
Hello, I am using a 2017 MacBook Pro with an Intel chip, running Ruby version 2.7.8, Rails 5.2.6, and OpenSSL 1.1. I've installed Ruby using rbenv and ruby-build. I am persistently receiving the following error when trying to create a database with Rails: WARNING: /Users/logan/.rbenv/versions/2.7.8/bin/ruby is loading libcrypto in an unsafe way zsh: abort bundle exec bin/rails db:create Steps I have taken to troubleshoot this issue: Installed OpenSSL via Homebrew and ensured that the version is 1.1. Uninstalled and reinstalled Ruby with rbenv, specifying the correct OpenSSL directory. Set the DYLD_LIBRARY_PATH environment variable to the path where Homebrew installed the OpenSSL libraries before running the Ruby process. Unfortunately, none of these steps have resolved the problem. I am seeking assistance in resolving this issue. Any guidance or insight into what might be causing this error and how to fix it would be greatly appreciated. Thank you in advance for your time and help!
Posted
by
Post not yet marked as solved
0 Replies
579 Views
I regularly see questions from folks who’ve run into problems with their third-party IDE on macOS. Specifically, the issue is that their IDE is invoking Apple’s command-line tools — things like clang and ld — and that’s failing in some way. This post collects my ideas on how to investigate, and potentially resolve, issues like this. If you have any questions or comments, please put them in a new thread here on DevForums. Tag it appropriately so that I see it. Good tags include Compiler, Linker, LLVM, and Command Line Tools. Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = "eskimo" + "1" + "@" + "apple.com" Investigating Third-Party IDE Integration Problems Many third-party IDEs rely on Apple tools. For example, the IDE might run clang to compile C code or run ld to link object files. These IDEs typically don’t include the tools themselves. Rather, they rely on you to install Xcode or Apple’s Command Line Tools package. These are available at Apple > Developer > Downloads Occasionally I see folks having problems with this. They most typically report that basic stuff, like compiling a simple C program, fails with some mysterious error. If you’re having such a problem, follow the steps below to investigate it. IMPORTANT Some IDEs come with their own tools for compiling and linking. Such IDEs are not the focus of this post. If you have problems with an IDE like that, contact its vendor. Select Your Tools macOS has a concept of the current command-line tools. This can either point to the tools within Xcode or to an installed Command Line Tools package. To see which tools are currently selected, run xcode-select with the --print-path argument. This is what you’ll see if you have Xcode installed in the Applications folder: % xcode-select --print-path /Applications/Xcode.app/Contents/Developer Note All of the tools I discuss here are documented in man pages. If you’re not familiar with those, see Reading UNIX Manual Pages. And this is what you’ll see with a Command Line Tools package selected. % xcode-select --print-path /Library/Developer/CommandLineTools There are two common problems with this: It points to something you’ve deleted. It points to something unexpected. Run the command above to see the current state. If necessary, change the state using the --switch option. For example: % xcode-select --print-path /Applications/Xcode.app/Contents/Developer % clang -v Apple clang version 14.0.3 (clang-1403.0.22.14.1) … % sudo xcode-select --switch ~/XcodeZone/Xcode-beta.app % clang -v Apple clang version 15.0.0 (clang-1500.0.38.1) … I have Xcode 14.3 in the Applications foledr and thus clang runs Clang 14.0.3. I have Xcode 15.0b5 in ~/XcodeZone, so switching to that yields Clang 15.0.0. It’s possible to run one specific command with different tools. See Select Your Tools Temporarily, below. Run a Simple Test A good diagnostic test is to use the selected command-line tools to compile a trivial test program. Consider this C [1] example: % cat hello.c #include <stdio.h> int main(int argc, char ** argv) { printf("Hello Cruel World!\n"); return 0; } % clang -o hello hello.c % ./hello Hello Cruel World! IMPORTANT If possible, run this from Terminal rather than, say, over SSH. You may need to expand this test program to exercise your specific case. For example, if your program is hitting an error when it tries to import the Core Foundation framework, add that import to your test program: % cat hello.c #include <stdio.h> #include <CoreFoundation/CoreFoundation.h> int main(int argc, char ** argv) { printf("Hello Cruel World!\n"); return 0; } When you compile your test program, you might see one of these results: Your test program compiles. Your test program fails with a similar error. Your test program fails with a different error. I’ll explore each case in turn. [1] For a C++ example, see C++ Issues, below. If your test program compiles… If your test program compiles from the shell, that proves that your basic command-line tools setup is fine. If the same program fails to compile in your IDE, there’s something IDE-specific going on here. I can’t help you with that. I recommend that you escalate the issue via the support channel for your IDE. If your test program fails with a similar error… If your test program fails with an error similar to the one you’re seeing in your IDE, there are two possibilities: There’s a bug in your test program’s code. There’s an environmental issue that’s affecting your command-line tools setup. Don’t rule out the first possibility. I regularly see folks bump into problems like this, where it turns out to be a bug in their code. For a specific example, see C++ Issues, below. Assuming, however, that your test program’s code is OK, it’s time to investigate environmental issues. See Vary Your Environment, below. If your test program fails with a different error… If your test program fails with a different error, look at the test program’s code to confirm that it’s correct, and that it accurately reflects the code you’re trying to run in your IDE. Vary Your Environment If your test program fails with the same error as you’re seeing in your IDE, and you are sure that the code is correct, it’s time to look for environmental factors. I typically do this with the steps described in the next sections, which are listed from most to least complex. These steps only tell you where things are going wrong, not what is going wrong. However, that’s often enough to continue the investigation of your issue. Vary Your Shell Try running your commands in a different shell. macOS’s default shell is zsh. Try running your commands in bash instead: % bash … bash-3.2$ clang -o hello hello.c bash-3.2$ ./hello Hello Cruel World! Or if you’ve switched your shell to bash, try it in zsh. Vary Your User Account Some problems are caused by settings tied to your user account. To investigate whether that’s an issue here: Use System Settings > Users & Groups to create a new user. Log in as that user. Run your test again. Vary Your Mac Some problems are system wide, so you need to test on a different Mac. The easiest way to do that is to set up a virtual machine (VM) and run your test there. Or, if you have a separate physical Mac, run your test on that. Vary Your Site If you’re working for an organisation, they may have installed software on your Mac that causes problems. If you have a Mac at home, try running your test there. It’s also possible that your network is causing problems [1]. If you have a laptop, try taking it to a different location to see if that changes things. [1] I rarely see this when building a simple test program, but it do see it with other stuff, like code signing. C++ Issues If you’re using C++, here’s a simple test you can try: % cat hello.cpp #include <iostream> int main() { std::cout << "Hello Cruel World!\n"; } % clang++ -o hello hello.cpp % ./hello Hello Cruel World! A classic problem with C++ relates to name mangling. Consider this example: % cat hello.c #include <stdio.h> #include "hello-core.h" int main(int argc, char ** argv) { HCSayHello(); return 0; } % cat hello-core.cpp #include "hello-core.h" #include <iostream> extern void HCSayHello() { std::cout << "Hello Cruel World!\n"; } % cat hello-core.h extern void HCSayHello(); % clang -c hello.c % clang++ -c hello-core.cpp % clang++ -o hello hello.o hello-core.o Undefined symbols for architecture x86_64: "_HCSayHello", referenced from: _main in hello.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) The issue here is that C++ generates a mangled name for HCSayHello: % nm hello-core.o | grep HCSayHello 0000000000000000 T __Z10HCSayHellov whereas C uses the non-mangled name: % nm hello.o | grep HCSayHello U _HCSayHello The fix is an appropriate application of extern "C": % cat hello-core.h extern "C" { extern void HCSayHello(); }; Select Your Tools Temporarily Sometimes you want to temporarily run a command from a particular tools package. To continue my earlier example, I currently have Xcode 14.3 installed in the Applications folder and Xcode 15.0b5 in ~/XcodeZone. Xcode 14.3 is the default but I can override that with the DEVELOPER_DIR environment variable: % clang -v Apple clang version 14.0.3 (clang-1403.0.22.14.1) … % DEVELOPER_DIR=~/XcodeZone/Xcode-beta.app/Contents/Developer clang -v Apple clang version 15.0.0 (clang-1500.0.38.1) …
Posted
by
Post marked as solved
1 Replies
1.3k Views
Hi, I am trying to reinstall ffmpeg n terminal however keep getting a message saying. Error: python 3.9: the bottle needs the Apple Command Line Tools to be installed. You can install them, if desired, with: xcode-select --install So I enter xcode-select --install in terminal and a window opens telling me the xcode select command requires the command line developer tools and do I wish to install the. I click on Install and get agreement window which I agree and then two windows: "Continue on battery power" and :Finding Software" If I click 'Continue on battery power", immediately the progress bar jumps to about 1/6 progress and then never moves any further. With or without a mains lead connected? Any help to resolve this? I have seen advice on installing the command line tools direct from the Apple Developer Page, but cannot find a correct link. Many thanks.
Posted
by
Post not yet marked as solved
1 Replies
501 Views
With these specs which XCode version can i download? will it be enough to begin IOS Development? Mac OS Catalina macbook pro 15 inch mid 2012 processor: 2.3 GHz Quad Core Intel Core i7 Memory 8GB 1600MHz DDR3 Graphics: NVIDA geforce gt 650M 512MB Intel HD Graphics 4000 1536MB Storage: 240GB Solid State SATA Drive
Posted
by