Hello,
is there any fix for this topic ?
[https://discussions.apple.com/thread/255892202)
Any hints would be much appreciated.
:)
G
Command Line Tools
RSS for tagCommand line tools allow for easy installation of open source software or development on UNIX within Terminal.
Posts under Command Line Tools tag
98 Posts
Sort by:
Post
Replies
Boosts
Views
Activity
Hi, I am trying to build a command line app that read local mov files and print the text to the terminal. When I open the file with VNImageRequestHandler(url: url), where the url is a hardcode path to my desktop file, the terminal reports CRImage Reader Detector was given zero-dimensioned image (0 x 0). Anyone can help? Thanks!
We have a tool in our CI which periodically updates our iOS project's Swift Package Manager dependencies. The script that does a few things, but generally speaking it
first removes the existing package.resolved at
./ProjectName.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
and then runs:
xcodebuild -resolvePackageDependencies -disablePackageRepositoryCache
This regenerated the package.resolved file to reflect the latest, updated versions of the dependencies. It is the equivalent of doing Xcode > File > Packages> Update to Latest Package Versions.
This has been working perfectly for a long time, but has stopped working since we moved from Xcode 15.4 to Xcode 16. I have also tested this with Xcode 16.1 and 16.2 - with no luck.
I have tried running this command locally, and can confirm it is not an issue with the environment of our CI. I have also tried swift package update.
Both of these commands appear to work - no errors are thrown, and the logs say "resolved source packages". However, they are not updating the packages. They are making no changes to the package.resolved file.
However, using Xcode > File > Packages> Update to Latest Package Versions in Xcode 16 works as expected - the packages are updated and the .resolved file is updated.
Is there now a different way to update Swift packages via the command line, or is this likely an Xcode 16 bug?
Update: This feels broken, so I have submitted a Feedback Report (FB16108036) but perhaps someone can suggest a workaround for the time being!
Hi,
I'm trying to set up automated backups on my machine using a combination of restic, a wrapper script, and a launchd agent, but I think I'm hitting a problem with the local network privacy dialogue.
Basically, the script sets up the environment variables for Restic, which then tries to backup to a local REST server. Problem is, when trying to do that, I get the following error:
Fatal: unable to open config file: Head "https://X:X@X.X.X.network:8000/X/X.X.X.network/config": dial tcp 192.168.50.229:8000: connect: no route to host
So it resolves DNS just fine, but can't connect to the local server. I tried a couple of things, tools such as ping work and can ping the local server, but nothing I do fixes the issue with restic itself. After reading about the network privacy feature, which I loved by the way, I believe it's the culprit here.
This is the .plist file I'm using, which lives in ~/Library/LaunchAgents/com.james.local-backup.plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.james.local-backup</string>
<key>ProgramArguments</key>
<array>
<string>/Users/james/.local/bin/replicator</string>
<string>--backup</string>
<string>rest:https://X.X.X.network:8000/X/X.X.X.network</string>
</array>
<key>EnvironmentVariables</key>
<dict>
<key>PATH</key>
<string>/opt/homebrew/opt/coreutils/libexec/gnubin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin</string>
<key>XDG_CONFIG_HOME</key>
<string>/Users/james/.config</string>
</dict>
<key>StartCalendarInterval</key>
<dict>
<key>Hour</key>
<integer>13</integer>
<key>Minute</key>
<integer>0</integer>
</dict>
<key>StandardErrorPath</key>
<string>/tmp/com.user.backup.err</string>
<key>StandardOutPath</key>
<string>/tmp/com.user.backup.out</string>
<key>ProcessType</key>
<string>Background</string>
</dict>
</plist>
The local network dialogue never shows up, so I can't give the wrapper script or restic access to the local network, which I assume is why it can't connect to the local server.
Any way I can solve this? I could build a proper Swift CLI that calls restic, but I assume I'd hit the same issue. Plus, it seems overkill for my needs.
When I use the xctrace symbolize command to symbolize a trace file, the command runs normally and ends, but only part of the stack is symbolized in the generated symbolized trace file. If I use Instruments to open the symbolized trace file, I will see the symbolized status of the corresponding library in the symbols window as Awaiting Resymbolication.
I have two macOS applications: Application A, named My App.app with the bundle ID com.comp.myapp, and Application B, named My App.app with the bundle ID com.comp.myapp2. Both applications have the same name. Application A is installed at /Applications/My App.app. When I run the installer for Application B, it gets installed in a folder at /Applications/My App.localized/My App.app. Even if I remove Application A using the preinstall script of Application B's installer, the result remains the same.
Does the installer determine the installation path with the new folder before the preinstall script executes?
How can it be addressed so the new folder will not be created?
Notes:
We have a composite package that contains multiple components. Instead of just running pkgbuild, we use our own components.plist rather than a synthesized one. The components.plist is attached.
The PackageInfo for Application B is also attached.
components.plist
PackageInfo
packageInfo.xml
components.plist
Hi,
I need to pass the launch arguments through xcodebuild command. Is there a way to do it?
I know we can edit scheme and add launch argument but it needs to be added to through command line.
P.S: I'm using azure devops @Xcode5 to build and sign the .ipa
xcodebuild -sdk iphoneos -configuration Debug -workspace my.xcworkspace -scheme myScheme clean CODE_SIGNING_ALLOWED=NO -launchArgument "MyLaunchArguments"
I would like to change the Mac OS terminal settings, shellExitAction value from the default to others value example 0 or 1.
I know we can use the defaults command to edit the property list of the terminal. But the value for shellExitAction is nested in the Window Settings value.
How to defaults write com.apple.terminal "Window Settings" -string 'Basic { shellExitAction = 2 }; ' correctly?
The above I tried is not working and the value does not change.
I updated my computer to Sonoma, and now my LaunchDaemon will not load.
I have the following setup :
File in /Library/LaunchDaemons/com.startup.plist
like this :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.startup</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/bash</string>
<string>/Library/Scripts/Startup/startup.sh</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>StandardErrorPath</key>
<string>/tmp/com.startup.stderr</string>
<key>StandardOutPath</key>
<string>/tmp/com.startup.stdout</string>
</dict>
</plist>
File in File in /Library/Scripts/Startup/startup.sh
#!/bin/zsh
PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users:/Users/root:/Users/root/Scripts:/Library/Scripts:/Library/Scripts/Startup
#Load modules for Fuse
/Library/Filesystems/macfuse.fs/Contents/Resources/load_macfuse
/usr/sbin/sysctl -w vfs.generic.macfuse.tunables.allow_other=1
#Connect to XXXXXX_net
/bin/sleep 28
myip=0
while [ $myip = 0 ]
do
/bin/sleep 3
myip=$(ifconfig -l | xargs -n1 ipconfig getifaddr)
done
/usr/local/bin/sshfs XXXX@XXXXXX.net: /Volumes/XXXXXX.net -o local,auto_cache,reconnect,ServerAliveInterval=15,ServerAliveCountMax=3,ConnectTimeout=5,daemon_timeout=60,iosize=2097152,volname=XXXXXX.net,allow_other,defer_permissions,async_read,Ciphers=aes128-gcm@openssh.com,Cipher=aes128-gcm@openssh.com,compression=no
And then we need some commands to be run as root user during boot :
/private/etc/sudoers.d/startup-script-nopasswd
username ALL = (root) NOPASSWD: /usr/sbin/sysctl
username ALL = (root) NOPASSWD: /usr/local/bin/sshfs
As of now, I cant even get the /Library/LaunchDaemons/com.startup.plist
to run after i updated the macOS to Sonoma ….
I need to call xcodebuild build -scheme XYZ from a different location than Package.swift and without a navigation. Is it possible? Can I provide some argument with a path?
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?
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.
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?
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.
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.
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)?
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?
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?
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/
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)