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

112 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

Is the usdzconvert(usdpython) of Apple open source?
I can only download usdpython from following website: https://developer.apple.com/augmented-reality/tools/ And where could I get the various versions of the usdpython? Is the usdzconvert(usdpython) of Apple open source? Because I wanna learn how Apple achieves the conversion from GLTF to USDZ because I'm currently using version 0.66, and I feel that the conversion of GLTF features is not quite sufficient.
2
0
824
Oct ’23
xcrun: error: invalid active developer path
I have this problem: xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun "make all" terminated with exit code 1. Build might be incomplete. Could someone help me? Two days ago I installed the last software update to MacOS: 12.2.1 but I haven't installed the command line for Xcode cause I'm not using Xcode for programming. Could this be the problem? Thanks for the support.
11
4
29k
Oct ’23
rvictl silent fail on M1 MBA w/ OS 14.0 Xcode 15.0
Hoping for updated guidance on rvictl on M1 platform. Need to do some network packet capture for an app running in iOS on an iPhone. I have read through previous related threads on this issue but final reports were "all fixed" but I am unable to get rvictl to create an interface for an attached iOS device. Security policy is set permissive in Recovery console kext was accepted in Privacy & Security, rebooted as required "rpmuxd" does not appear to be running. Poking around in the plist file I note that "/usr/libexec/rpmuxd" does not exist on my system. Not sure how this all relates. Welcome any guidance, thanks! rvictl doesn't report FAILED, just silently exits: % sudo rvictl -s 000080300-XXXXXXXXXX % Codesign reports OK: % codesign -v -vvv "/Library/Apple/System/Library/Extensions/RemoteVirtualInterface.kext" /Library/Apple/System/Library/Extensions/RemoteVirtualInterface.kext: valid on disk /Library/Apple/System/Library/Extensions/RemoteVirtualInterface.kext: satisfies its Designated Requirement rvictl is in path: % which -a rvictl /Library/Apple/usr/bin/rvictl rvictl list doesn't work: % sudo rvictl -l bootstrap_look_up(): 1102 Could not get list of devices Cannot manually kextload again: % sudo kextload /Library/Apple/System/Library/Extensions/RemoteVirtualInterface.kext Executing: /usr/bin/kmutil load -p /Library/Apple/System/Library/Extensions/RemoteVirtualInterface.kext Error Domain=KMErrorDomain Code=71 "Kernel request failed: (libkern/kext) kext (kmod) start/stop routine failed (-603946985)" UserInfo={NSLocalizedDescription=Kernel request failed: (libkern/kext) kext (kmod) start/stop routine failed (-603946985)}
0
0
449
Oct ’23
Shell script which uses Swift and CryptoKit underneath doesn't work after updating to Xcode 15 and MacOS Sonoma
Hi, I'm having some trouble running a shell script that worked before I updated the Xcode and my MacOS. This is probably connected to the command line tools which were updated with these upgrades. I can't switch to an older version of the command line tools to verify this theory tho... The script uses CryptoKit to decrypt some data which was encrypted using a SymmetricKey. The script: #!/bin/bash # # DecryptScript.sh # # This script decrypts encrypted data using a symmetric key. # Check for the correct number of arguments if [ "$#" -ne 2 ]; then echo "Usage: $0 <encrypted_file_path> <decrypted_file_path>" exit 1 fi # Get the input arguments encryptedFilePath="$1" decryptedFilePath="$2" # Find the path to the script's directory scriptDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # Check if the symmetric key file exists in the same directory symmetricKeyPath="$scriptDir/.sim.key" if [ ! -f "$symmetricKeyPath" ]; then echo "SymmetricKey file was not found in the same directory as the script." exit 1 fi # Decrypt the data swift - <<EOF import Foundation import CryptoKit let symmetricKeyURL = URL(fileURLWithPath: "$symmetricKeyPath") let encryptedDataURL = URL(fileURLWithPath: "$encryptedFilePath") let decryptedDataURL = URL(fileURLWithPath: "$decryptedFilePath") guard let symmetricKeyData = try? Data(contentsOf: symmetricKeyURL) else { fatalError("Failed to read symmetric key data") } guard let encryptedData = try? Data(contentsOf: encryptedDataURL) else { fatalError("Failed to read encrypted data") } do { // Decrypt the data using AES-GCM let decryptionKey = SymmetricKey(data: symmetricKeyData) let sealedBox = try AES.GCM.SealedBox(combined: encryptedData) let decryptedData = try AES.GCM.open(sealedBox, using: decryptionKey) // Write the decrypted data to a file try decryptedData.write(to: decryptedDataURL) print("Decryption successful. Decrypted file saved at \(decryptedDataURL)") } catch { print("Decryption failed: \(error.localizedDescription)") } EOF The code in the project which encrypts the data and retrieves the key: func encryptSymmetric(data: Data, password: String) throws -> (Data, Data) { let key = SymmetricKey(size: .bits256) guard let cipher = try? AES.GCM.seal(data, using: key).combined else { throw SomeCustomError.failedToEncryptData } let keyData = key.withUnsafeBytes { Data($0) } return (cipher, keyData) } The error I'm presented with in the terminal is JIT session error: Symbols not found: [ _$s9CryptoKit3AESO3GCMO4open_5using10Foundation4DataVAE9SealedBoxV_AA12SymmetricKeyVtKFZ, _$s9CryptoKit12SymmetricKeyVMa, _$s9CryptoKit3AESO3GCMO9SealedBoxV8combinedAGx_tKc10Foundation12DataProtocolRzlufC, _$s9CryptoKit12SymmetricKeyV4dataACx_tc10Foundation15ContiguousBytesRzlufC, _$s9CryptoKit3AESO3GCMO9SealedBoxVMa ] Failed to materialize symbols: { (main, { _$s4main16encryptedDataURL10Foundation0D0Vvp, _$s4main15symmetricKeyURL10Foundation0D0Vvp, _$s10Foundation4DataVAcA0B8ProtocolAAWL, _$s4main16decryptedDataURL10Foundation0D0Vvp, _$sSa12_endMutationyyF, _$ss5print_9separator10terminatoryypd_S2StFfA0_, _$ss27_finalizeUninitializedArrayySayxGABnlF, _main, _$s10Foundation4DataV15_RepresentationOWOe, _$sSSWOh, _$ss5print_9separator10terminatoryypd_S2StFfA1_, _$s10Foundation4DataV5write2to7optionsyAA3URLV_So20NSDataWritingOptionsVtKFfA0_, ___swift_allocate_value_buffer, __swift_FORCE_LOAD_$_swiftFoundation_$_main, _$s10Foundation4DataV10contentsOf7optionsAcA3URLVh_So20NSDataReadingOptionsVtKcfcfA0_, __swift_FORCE_LOAD_$_swiftXPC_$_main, _$s10Foundation4DataV15_RepresentationOWOy, ___swift_project_value_buffer, _$s10Foundation4DataVAcA0B8ProtocolAAWl, __swift_FORCE_LOAD_$_swiftIOKit_$_main, _$ss26DefaultStringInterpolationVWOh, __swift_FORCE_LOAD_$_swiftCoreFoundation_$_main, _$s10Foundation3URLVACs23CustomStringConvertibleAAWl, __swift_FORCE_LOAD_$_swiftDarwin_$_main, __swift_FORCE_LOAD_$_swiftObjectiveC_$_main, _$s10Foundation3URLVACs23CustomStringConvertibleAAWL, __swift_FORCE_LOAD_$_swiftDispatch_$_main }) } This leads me to believe that linking might not be working properly. I also found this thread where someone had the same issue but with a different framework. NOTE: If I try to decrypt the data in my project, it works without any issues even on Xcode 15. It only fails if I try to run this script which worked before when I had the previous version of command line tools. I even tried updating to Xcode 15.1 beta and its command line tools, without success. Any feedback is appreciated. Thank you.
2
1
1.1k
Oct ’23
How to create an xccovreport from an xcresult bundle.
We are having an issue when trying to view the the coveage report in our "merged result bundle" Running xccov view --report --only-targets merged.xcresult results in: 09:52:54 Error: Error Domain=XCCovErrorDomain Code=0 "Failed to load coverage archive in scheme action '(null)' in result bundle" UserInfo={NSLocalizedDescription=Failed to load coverage archive in scheme action '(null)' in result bundle, NSUnderlyingError=0x7f8ff8714f30 {Error Domain=NSCocoaErrorDomain Code=260 "The file “Metadata.plist” couldn’t be opened because there is no such file." UserInfo={NSFilePath=/tmp/action.xccovarchive/Metadata.plist, NSUnderlyingError=0x7f8ff8714930 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}}} Checking the man page for xccov I was inspired by the idea of extracting the coverage report from the result bundle to try to understand or work around our error. The man xccov page states that If xccov is passed a result bundle directly, it will extract the report or archive implicitly, as part of the action being requested. Alternatively, the raw report/archive files can be extracted from the result bundle using xcresulttool(1) and subsequently passed to xccov. Checking man xcresulttool and trying out some stuff randomly I was not able to learn how a person might: Given an xcresult bundle use xcresulttool to create/extract an xccovreport bundle.
7
4
3.1k
Oct ’23
macOS Sonoma broke grep (assertion fails)
grep is broken on Sonoma: printf '%s' '3.2.57(1)-release' | grep -o '[0-9.]*' Assertion failed: (advance > 0), function procline, file util.c, line 732. zsh: done printf '%s' '3.2.57(1)-release' | zsh: abort grep -o '[0-9.]*' For minimal reproducers, see: # fails printf '%s' 'a' | grep -o 'b*' # works printf '%s' 'a' | grep -o 'b' # also works (note: without -o flag) printf '%s' 'a' | grep 'b*' This is the source for the assertion: https://github.com/apple-oss-distributions/text_cmds/blob/c0780aa3432383e0acde7dc7cf42972716925de6/grep/util.c#L732 For posterity: /* * rdar://problem/86536080 - if our first match * was 0-length, we wouldn't progress past that * point. Incrementing nst here ensures that if * no other pattern matches, we'll restart the * search at one past the 0-length match and * either make progress or end the search. */ if (pmatch.rm_so == pmatch.rm_eo) { if (MB_CUR_MAX > 1) { wchar_t wc; int advance; advance = mbtowc(&wc, &pc->ln.dat[nst], MB_CUR_MAX); assert(advance > 0); nst += advance; } else { nst++; } } It looks like the macOS devs tried to fix one thing but broke another. I would update rdar://problem/86536080, but it looks like that's internal to Apple.
6
1
3k
Oct ’23
Documentation for MACOSX_DEPLOYMENT_TARGET?
Has MACOSX_DEPLOYMENT_TARGET been deprecated? I do not seem to find any proper documentation of it at apple.com. Background: I'm building C-based application(s) and libraries (both Intel and AS) that are distributed compiled/linked to our users. I would like to update my build machines from 10.15 (Intel) and 11 (AS), to macOS 12 (or even higher, if possible) but I would like to be sure that our users can run the executable and that they can link their code against our libraries (and our object code) also on older versions of macOS. Ideally I would like to continue to support users on macOS 10.15 on Intel and 11 on AS, but macOS 11 on Intel would also be acceptable. It seems MACOSX_DEPLOYMENT_TARGET (perhaps combined with SDKROOT) could allow this, but I have not been able to find anything except rumors, i.e. no proper documentation at any Apple site. Testing is not really an option since at least some problems would likely only occur at runtime (e.g. due to weak linking). I am using the command line tools and GNU make (no Xcode project or some such, also no App Store). Any pointers would be greatly appreciated!
3
0
1.5k
Oct ’23
Opening Safari with URL via terminal also opens URL in default browser (Chrome)
When using the command open in the terminal, there seems to be this weird issue/behavior where if run to open a specific application (in this case Safari) where my current default browser is Chrome, the following command would open up in both Safari and my default browser. open -a /Application/Safari.app/ https://www.google.com Opening up a different browser, such as Firefox does not have this issue. In that case, only the specified application does run as expected. open -a /Application/Firefox.app/ https://www.google.com open -a Firefox https://www.google.com Is this a bug or a desired effect? (Tested macOS 11.4)
2
1
2.2k
Oct ’23
macOS bundled OpenSSH 8.6p1 seems don't support FIDO keys
Since 8.2p1 OpenSSH support for FIDO/U2F hardware authenticators, add "ed25519-sk" and "ecdsa-sk" key type. macOS Monterey 12.2 bundled OpenSSH (version: 8.6p1) doesn't include built-in security keys support, but it seems that user can specify middle ware library to use FIDO authenticator-hosted keys (see man ssh-add, man ssh_config and man ssh-agent). I try to implement FIDO security key provider library, but bundled ssh-agent seems don't try to load the implemented library and simply return with "unknown or unsupported key type": $ ssh-agent -d -P "/*" SSH_AUTH_SOCK=SOME_VALUE; export SSH_AUTH_SOCK; echo Agent pid SOME_VALUE; debug1: new_socket: type = SOCKET debug2: fd 3 setting O_NONBLOCK debug1: new_socket: type = CONNECTION debug3: fd 4 is O_NONBLOCK debug1: process_message: socket 1 (fd=4) type 25 debug2: process_add_identity: entering debug1: parse_key_constraint_extension: constraint ext sk-provider@openssh.com debug1: process_add_identity: add sk-ssh-ed25519@openssh.com SHA256:KEY_HASH "KEY_COMMENT" (life: 0) (confirm: 0) (provider: /path/to/libsk-libfido2.so) debug1: new_socket: type = CONNECTION debug3: fd 4 is O_NONBLOCK debug1: process_message: socket 1 (fd=4) type 11 debug2: process_request_identities: entering debug1: process_message: socket 1 (fd=4) type 13 debug1: process_sign_request2: entering Confirm user presence for key ED25519-SK SHA256:KEY_HASH process_sign_request2: sshkey_sign: unknown or unsupported key type User presence confirmed Manually install OpenSSH from third-party (such as MacPorts/Homebrew, or simply build it from source code) works, but third-party OpenSSH can't read passwords stored in Keychain. Is bundled OpenSSH disable hardware key support at build time? Advice most appreciated. Thank you!
13
19
6.0k
Oct ’23
opendiff / FileMerge not showing identical files in light gray
On macOS 12.6 Monterey with Xcode 14.0.1 and FileMerge 2.11 (21012). I am not seeing identical files grayed out. The font color (black) is the same shade as those files that are different. Wondering if there is some setting with my account or with my macOS customizations since receiving this new M1 Max MacBook Pro in July 2022. I don't recall it ever working on this MacBook. I have compared my FileMerge preferences as well as my user account customizations with that of older MacBook running macOS 11.x Big Sur. Works just fine on Intel MBP on previous macOS and with older versions of Xcode.
3
0
2.9k
Oct ’23
devicectl appIcon command not working
Hi, I'm trying to use the appIcon command of devicectl. I'm connecting to an iPhone 14 Pro running iOS 17.0.2. xcrun devicectl device info appIcon --help OVERVIEW: Request app icon generation from this device. This command searches for an app installed on this device and requests for its icon to be generated. USAGE: devicectl device info appIcon [<options>] --device <uuid|ecid|udid|name> --allow-placeholder <allow placeholder> --width <width> --height <height> --scale <scale> DEVICE OPTIONS: -d, --device <uuid|ecid|udid|name> The identifier, ECID, UDID, or name of the device. COMMAND OPTIONS: --app-bundle-id <app bundle identifier> Look for app icon information with the given application bundle identifier on device. Note: If both app-bundle-id and app-path are provided, only app-path will be used. --app-path <app path> Look for app icon information at the given application path on device. Note: If both app-bundle-id and app-path are provided, only app-path will be used. --allow-placeholder <allow placeholder> Allow placeholder icons to be generated. Note: Passing `true` will allow placeholder icons to be returned. Allowing placeholder icons will ensure no I/O is done on device. If you want to make sure you get the icon most accurate to your request -- which could use more resources on the device -- set this to `false`. --width <width> Request app icon generation with the specified width. --height <height> Request app icon generation with the specified height. --scale <scale> Request app icon generation with the specified scale. --destination <destination> Write the image (in png format) to the provided file on the host device. OUTPUT OPTIONS: -v, --verbose If given, provide more logging output than normal. -q, --quiet If given, output will include only errors. -t, --timeout <seconds> The overall command timeout in seconds. If this limit is exceeded the command is abandoned as a failure. -j, --json-output <path> An optional path to write a JSON file with command results. Note: JSON output to a user-provided file on disk is the ONLY supported interface for scripts/programs to consume command output. -l, --log-output <path> An optional path to write all logging otherwise passed to stdout/stderr. OPTIONS: --version Show the version. -h, --help Show help information. I've tried multiple variations of parameters and both apple-bundle-id and app-path, but always receive an error. xcrun devicectl device info appIcon --device *** --app-bundle-id *** --app-path *** --allow-placeholder true --width 60 --height 60 --scale 3 --destination icon.png -j icon.json -t 10 -v With JSON output "error" : { "code" : 6007, "domain" : "com.apple.dt.CoreDeviceError", "userInfo" : { "NSLocalizedDescription" : { "string" : "CGImage was nil when attempting to write to a destination." } } }, Without JSON output 09:32:42 Acquired tunnel connection to device. 09:32:42 Enabling developer disk image services. 09:32:42 Acquired usage assertion. Application Icon Image Information • Is Placeholder - false • Size • Height - 0.0 • Width - 0.0 • Scale - 0.0 • Pixel Size • Height - 0.0 • Width - 0.0 Has anyone managed to successfully extract an app icon using devicectl?
3
0
952
Oct ’23
How to test against non-iOS17 SDKs with Xcode15 series command line tools?
Hello. I would like to perform UnitTest using the xcodebuild command in Xcode15 series, but it does not work. Specifically, I want to run the test on an iPhone 14 with iOS 16.4 simulator environment, but for some reason it fails due to a certificate mismatch. For some reason I don't want to test on iOS17, so I specify iOS16.4. The following is a pseudo-command to run the test. Thank you! xcodebuild -workspace AppWorkspace.xcworkspace -scheme App -sdk iphonesimulator -destination "platform=iOS Simulator,name=iPhone 14,OS=16.4" -configuration TestConfiguration test
1
0
533
Oct ’23
C++ Linker Error on M1 Mac running Hello World Program
I'm trying to run the program below on my M1 Pro MacBook Pro from the command line, but I am getting linker errors. Also, I do not want to use XCode, I like to develop in vim in my terminal and want to develop in the terminal rather than XCode. #include <iostream> #include <string> inline void print_string(std::string s = "Hello World!") { std::cout << s << std::endl; } int main() { print_string(); } The above program generates these errors: Undefined symbols for architecture arm64: "std::__1::locale::use_facet(std::__1::locale::id&) const", referenced from: std::__1::ctype<char> const& std::__1::use_facet<std::__1::ctype<char> >(std::__1::locale const&) in hello_world-fcbd23.o "std::__1::ios_base::getloc() const", referenced from: std::__1::basic_ios<char, std::__1::char_traits<char> >::widen(char) const in hello_world-fcbd23.o "std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__init(char const*, unsigned long)", referenced from: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::basic_string<std::__1::nullptr_t>(char const*) in hello_world-fcbd23.o "std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__init(unsigned long, char)", referenced from: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::basic_string(unsigned long, char) in hello_world-fcbd23.o "std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_string()", referenced from: _main in hello_world-fcbd23.o std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> > std::__1::__pad_and_output<char, std::__1::char_traits<char> >(std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> >, char const*, char const*, char const*, std::__1::ios_base&, char) in hello_world-fcbd23.o "std::__1::basic_ostream<char, std::__1::char_traits<char> >::put(char)", referenced from: std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::endl<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) in hello_world-fcbd23.o "std::__1::basic_ostream<char, std::__1::char_traits<char> >::flush()", referenced from: std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::endl<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) in hello_world-fcbd23.o "std::__1::basic_ostream<char, std::__1::char_traits<char> >::sentry::sentry(std::__1::basic_ostream<char, std::__1::char_traits<char> >&)", referenced from: std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::__put_character_sequence<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*, unsigned long) in hello_world-fcbd23.o "std::__1::basic_ostream<char, std::__1::char_traits<char> >::sentry::~sentry()", referenced from: std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::__put_character_sequence<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*, unsigned long) in hello_world-fcbd23.o "std::__1::cout", referenced from: print_string(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) in hello_world-fcbd23.o "std::__1::ctype<char>::id", referenced from: std::__1::ctype<char> const& std::__1::use_facet<std::__1::ctype<char> >(std::__1::locale const&) in hello_world-fcbd23.o "std::__1::locale::~locale()", referenced from: std::__1::basic_ios<char, std::__1::char_traits<char> >::widen(char) const in hello_world-fcbd23.o "std::__1::ios_base::__set_badbit_and_consider_rethrow()", referenced from: std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::__put_character_sequence<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*, unsigned long) in hello_world-fcbd23.o "std::__1::ios_base::clear(unsigned int)", referenced from: std::__1::ios_base::setstate(unsigned int) in hello_world-fcbd23.o "std::terminate()", referenced from: ___clang_call_terminate in hello_world-fcbd23.o "___cxa_begin_catch", referenced from: ___clang_call_terminate in hello_world-fcbd23.o std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::__put_character_sequence<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*, unsigned long) in hello_world-fcbd23.o "___cxa_call_unexpected", referenced from: std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> >::failed() const in hello_world-fcbd23.o std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> >::ostreambuf_iterator(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) in hello_world-fcbd23.o "___cxa_end_catch", referenced from: std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::__put_character_sequence<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*, unsigned long) in hello_world-fcbd23.o "___gxx_personality_v0", referenced from: _main in hello_world-fcbd23.o std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::__put_character_sequence<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*, unsigned long) in hello_world-fcbd23.o std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> > std::__1::__pad_and_output<char, std::__1::char_traits<char> >(std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> >, char const*, char const*, char const*, std::__1::ios_base&, char) in hello_world-fcbd23.o std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> >::failed() const in hello_world-fcbd23.o std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> >::ostreambuf_iterator(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) in hello_world-fcbd23.o std::__1::basic_ios<char, std::__1::char_traits<char> >::widen(char) const in hello_world-fcbd23.o ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) If I run c code with gcc it works, but for some reason this c++ code isn't working. Is there a fix for this that does not require me to use Xcode?
3
0
1.8k
Sep ’23
Command Line Tools Linker does not work for linking assembly and C code
On Ventura 13.5.2 (22G91), Macbook pro 13 2019 (Intel): The following combination of the C code and Assembly code fails to link conftest_c.c: //conftest_c.c: #ifdef __cplusplus extern "C" { #endif void gsym_test_func(void); #ifdef __cplusplus } #endif int main() { gsym_test_func(); return 0; } Obj compiled using the command clang -O3 -DNDEBUG -finline-functions -fno-strict-aliasing -mcx16 -I. conftest_c.c -c produces conftest_c.o That exposes the following symbols: SYMBOL TABLE: 0000000000000000 g F __TEXT,__text _main 0000000000000000 *UND* _gsym_test_func Now we create assembly conftest.s that define _gsym_test_func: .text # _gsym_test_func .globl _gsym_test_func _gsym_test_func: # _gsym_test_func with the objdumb symbols: SYMBOL TABLE: 0000000000000000 g F __TEXT,__text _gsym_test_func Trying to link the two object files into a binary using the following command clang -O3 -DNDEBUG -v -finline-functions -fno-strict-aliasing -mcx16 conftest_c.o conftest.o -o conftest -lz results in the following error: Apple clang version 15.0.0 (clang-1500.0.40.1) Target: x86_64-apple-darwin22.6.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin "/Library/Developer/CommandLineTools/usr/bin/ld" -demangle -lto_library /Library/Developer/CommandLineTools/usr/lib/libLTO.dylib -dynamic -arch x86_64 -platform_version macos 13.0.0 14.0 -syslibroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -O3 -o conftest -L/usr/local/lib conftest_c.o conftest.o -lz -lSystem /Library/Developer/CommandLineTools/usr/lib/clang/15.0.0/lib/darwin/libclang_rt.osx.a ld: Undefined symbols: _gsym_test_func, referenced from: _main in conftest_c.o clang: error: linker command failed with exit code 1 (use -v to see invocation) I do not understand why the linker cannot find the symbol _gsym_test_func defined in conftest.o
5
1
951
Sep ’23
`Bad file descriptor` when copying using hardlink flag
When I try to link a file on macOS, I get: $ cp -l release-source/release/examples/stubs-1-pubsub.test.js . cp: ./stubs-1-pubsub.test.js: Bad file descriptor This made it seem like the copying failed, but ls shows it went fine: $ ls -li release-source/release/examples/stubs-1-pubsub.test.js stubs-1-pubsub.test.js 9825657 -rw-r--r-- 2 carlerik staff 1072 26 sep 16:24 release-source/release/examples/stubs-1-pubsub.test.js 9825657 -rw-r--r-- 2 carlerik staff 1072 26 sep 16:24 stubs-1-pubsub.test.js A related post talks about this error coming from the file system, not the cp util itself. Creating a hard link using the ln command works fine, so the error must be due to something cp does that ln does not, so I fired up the console and captured messages hoping to see something. I cannot see that I do ... Does anyone have an idea what this is caused by? System information ❯ npx envinfo --system System: OS: macOS 13.5.2 CPU: (12) arm64 Apple M2 Max Memory: 4.24 GB / 64.00 GB Shell: 5.2.15 - /opt/homebrew/bin/bash ❯ diskutil list /dev/disk0 (internal, physical): #: TYPE NAME SIZE IDENTIFIER 0: GUID_partition_scheme *2.0 TB disk0 1: Apple_APFS_ISC Container disk1 524.3 MB disk0s1 2: Apple_APFS Container disk3 2.0 TB disk0s2 3: Apple_APFS_Recovery Container disk2 5.4 GB disk0s3
3
2
1.4k
Sep ’23
Building an xcframework with MacOS and Mac Catalyst support
Using xcodebuild, I have built (and archived) several variations of a framework with the following destinations: 'generic/platform=iOS', 'generic/platform=iOS Simulator', 'generic/platform=macOS', 'generic/platform=macOS,variant=Mac Catalyst' I now wish to combine the frameworks into an xcframework using the -create-xcframework switch to xcodebuild. As arguments I am passing an instance of each Archive and the framework to xcodebuild. For example: xcodebuild -archive mycode_ios.xcarchive -framework mycode.framework -archive mycode_ios_simulator.xcarchive -framework mycode.framework [... others here ...] -output mycode.xframework With the destinations above I get an error message: A library with the identifier 'macos-arm64_x86_64' already exists. I assume that the macOS framework and the Mac Catalyst framework are conflicting with one another as they share the same platform and architectures. For that matter I guess the iOS simulator may also be considered macOS with those architectures. How are the "library identifiers" generated and is there a way I can ensure the Mac Catalyst, MacOS, and iOS simulator identifiers are distinct? Perhaps I do not need to? Then what is the minimum set of frameworks I would need to support MacOS, Mac Catalyst, iOS (device) and iOS Simulator in one xcframework?
1
0
821
Sep ’23
Cmake and ninja still referencing old SDK after upgrading to XCode command line tools 14.3.1
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 -&gt; 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?
3
1
2.4k
Sep ’23
Apple 403 detected - Access forbidden.
I am trying to build my react native app using expo cli, The command i am using to build my development build is : eas build --profile development --platform ios And i am getting the following error: Apple 403 detected - Access forbidden. This request is forbidden for security reasons - You currently dont have access to this membership resource. Contact your team's Account Holder This is not a new issue and it did not got fixed when my role was updated from Developer to App Manager on App Store Connect. There are github comments that mention the problem gets resolved after reporting the issue in the forums.. so thats what i did. Github reference: https://github.com/expo/eas-cli/issues/880 Thank you
1
0
1.4k
Sep ’23