Post not yet marked as solved
I am relatively new to coding on Mac so I apologize in advance if the question is too simple. I encounter the following error when executing a code after updating the OS to Bug Sur:
ld: unsupported tapi file type '!tapi-tbd' in YAML file '/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/lib/libm.tbd' for architecture x86_64 collect2: error: ld returned 1 exit status
The code compiles but the does not give an output file. Everything was working perfectly before updating. Following instructions to a somewhat similar question, I un-installed the CLT and tried to reinstall the 11.5 version but that couldn't be done and the error was the version of Mac is too new. I'd appreciate any help or suggestions on this.
Post not yet marked as solved
Hi!
I've run into some problems with running unit tests for iOS framework project recently. It had worked, but it stopped since one of the command line tool's updates.
When I try to run unit tests with a command line (xcodebuild) I get 'Failed to create a bundle instance representing' error. But only for an iOS framework project and when -derivedDataPath is set with a custom path.
xcodebuild -project TestFramework.xcodeproj -scheme TestFramework -derivedDataPath ./output -destination 'platform=iOS Simulator,id=***' clean build test
In the Xcode I can run tests without any problems.
When I remove -derivedDataPath parameter, it works like a charm as well. On the other hand, unit tests for an iOS application project works from command line and Xcode, whenever I set -derivedDataPath flag or not.
Has any of you been dealing with the same problem? Or do you know any solution? Or is it a known issue?
Cheers!
PS.
$ xcodebuild -version
Xcode 12.4
Build version 12D4e
$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.15.7
BuildVersion: 19H2
Post not yet marked as solved
Greetings, All.
I wish to build gcc-9.2.0 on my M1 Mini. Note that I am not really interested in gcc, as Apple's clang compiler is fantastic, but actually in gm2, which is written as a front end to gcc.
Now, I understand that the gcc folk do not support M1, so I tried to build a cross-compiler to run under Rosetta-2, namely set both host and build to x86_64-darwin. The build trundles along (well, it flies -- this h/w is fast!) until it reaches "fixing" the header files. The path /usr/include is hard-coded throughout the build tools and it comes to a screeching halt.
So how to fool the gcc build tools?
The system will not let me create a symlink in /usr. I tried prepending an appropriate path from xcrun to the hard-code path but there are a *lot* of them.
This is not a priority so I can just await M1 support.
Thank you.
jog
Post not yet marked as solved
When running a cfgutil command I can verify across multiple OS versions, 10.15.7, and 11 that we get the following.
% cfgutil get all
objc[2358]: Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libauthinstall.dylib (0x7fff8ad23a30) and /System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x10681a8c0). One of the two will be used. Which one is undefined.
objc[2358]: Class AMSupportURLSession is implemented in both /usr/lib/libauthinstall.dylib (0x7fff8ad23a80) and /System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x10681a910). One of the two will be used. Which one is undefined.
cfgutil: error: Error Domain=NSCocoaErrorDomain Code=3840 "Found non-key inside dict at line 112188" UserInfo={NSDebugDescription=Found non-key inside dict at line 112188, kCFPropertyListOldStyleParsingError=Error Domain=NSCocoaErrorDomain Code=3840 "Malformed data byte group at line 1; invalid hex" UserInfo={NSDebugDescription=Malformed data byte group at line 1; invalid hex}}
Are the binaries from more recent versions of cctools available somewhere on the internet to download?
With the command line tools from Xcode 12, install_name_tool -id stores the current timestamp (to 1 second resolution) in the file even when I have exported ZERO_AR_DATE=1.
However, when I download cctools-973 - https://opensource.apple.com/release/developer-tools-120.html, and build my own version of install_name_tool without any modifications, then the new binary does not have this behavior. On looking at the source code all the way up to cctools-410, I notice comments (see comments for line #undef OUTPUT_OPTION in this file) - https://opensource.apple.com/source/cctools/cctools-410.1/misc/install_name_tool.c.auto.html hinting that this behavior was fixed at some point.
Given that install_name_tool does not have version information, it is hard to say which version of cctools is currently shipping with Xcode.
To reproduce the behavior I mentioned above that is observed with cctools from Xcode CLT, but not with the open source versions:
$ cat foo.c
void a() {}
$ clang -g -c foo.c -o foo.o
$ clang -dynamiclib -o foo.so foo.o
$ shasum foo.so
$ for attempt in {1..4}; do sleep 1 && install_name_tool -id "foo.so" foo.so && shasum foo.so; done
Post not yet marked as solved
After update my Mac OS Big sur 11.4 my pod not working giving below error, any one can help.
jahangir@Jahangirs-MacBook-Pro New12 % pod init
zsh: /usr/local/bin/pod: bad interpreter: /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby: no such file or directory
jahangir@Jahangirs-MacBook-Pro New12 %
Post not yet marked as solved
I have uninstalled all references to Node and re-installed Node.js, which is supposed to include NPM. However, when I attempt to start the Firebase emulators - this error is still occurring and not allowing the emulators to start. I am out of options on Git and StackOverflow as nothing remains consistent for solutions this far.
I am also using an M1 2020 version.
Thank you.
Post not yet marked as solved
Just trying to run a simple command line tool on xcode - using C. I get the following and I have no idea why.
Message from debugger: Error 1
Program ended with exit code: -1
Post not yet marked as solved
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)
Post not yet marked as solved
The goal is to set breakpoints with some actions and log state on certain conditions for later analysis.
I am thinking that it should be possible via lldb, however, I couldn't think of how to use it in combination to xcodebuild (test). Any help would be much appreciated.
Post not yet marked as solved
Hi, I'm new to programming and learning to write code in C for my degree. I'm comfortable with the code side of things, however struggling to get my head around the layout of Xcode and creating projects etc.
Is it possible to create a project with multiple 'programmes' within it? For example I create a project for 'Monday's lecture' that I have several separate source codes in it that are independent of each other to cover each aspect of the lecture?
Also how do I get my programme to compile and run in terminal rather than the window at the bottom of Xcode's? Thanks
Post not yet marked as solved
My IDE like app built with electron allows to spawn a terminal by means of forkpty. Although this is also working in the MAS build, the sandboxed environment results in the terminal being mostly unusable (which I expected).
From a technical perspective, what would be the best way to allow an unrestricted terminal experience? Obviously I'd need the terminal process to be spawned outside the sandboxed environment.
My initial thinking was that I could create some kind of "Helper" app that the user has to run manually. This app would then run outside the sandbox and would provide a terminal API to my sandboxed app by means of TCP or IPC Socket communication. But this would have multple drawbacks:
Uncomfortable for the user because he has to spawn the helper app
The communication sockets could be abused by others
I'm sure there exist many other apps on the Mac App Store that face the same problem (running a process outside the sandboxed environment).
What is the best way to solve this? Is it even allowed?
Post not yet marked as solved
I need to a NEProvider directly inside a command line tool, particularly, the NEFilterDataProvider, and found that what was calling was the NEFilterDataExtensionProviderContext class, but it seems like Apple has it blocked off. Is there any way that I can do this? Thanks
Post not yet marked as solved
When i tried downlaod Command_Line_Tools_for_Xcode_12.5.1 from https://download.developer.apple.com
I got a error:
The following error was encountered:
Connection Failed
The system returned:
(71) Protocol error
The remote host or network may be down. Please try the request again.
what should i do .....
Post not yet marked as solved
Hello I program in C++ and I like to compile and run my code through terminal but when I link a library through Xcode this error is showing in Terminal
main.cpp:5:10: fatal error: 'Console.h' file not found
#include <Console.h>
^~~~~~~~~~~
1 error generated.
and I the library is linked because it work fine in Xcode console
but I can't use system(); because some TERM environment variable not set.
and sorry if this is a easy question to answer and google but
I didn't now how to google some fix and I used Mac like for 6 days so I very new to all this
Post not yet marked as solved
Hello, I am trying to launch an app via the CLI.
I am able to build and run the app via Xcode's UI. The iPhone simulator is an iPhone 11. The OS is 14.4.
I am using xcodebuild 12.4 and Xcode 12.4
I tried:
build_app = ’xcrun xcodebuild -scheme MyDemo -project MyDemo/MyDemo.xcodeproj -configuration Debug -destination \‘platform=iOS Simulator,name=’ + iOS_SIMULATOR_NAME + ‘,OS=‘+ iOS_SIMULATOR_OS + ‘\’ -derivedDataPath MyDemo/build -UseModernBuildSystem=YES’
install_app = ‘xcrun simctl install booted MyDemo/build/Build/Products/Debug-iphonesimulator/MyDemo.app/’
launch_app = ‘xcrun simctl launch booted com.MyDemo’
uninstall_app = ‘xcrun simctl uninstall booted com.MyDemo’
I am able to build with these commands, but not able to launch the app.
I keep getting the error code:
FBSOpenApplicationErrorDomain error 3
I have cleared the simulator, deleted it and reinstalled it, and cleared my DerivedData.
I am wondering if anyone has any suggestions?
Thanks!
After Using command in terminal:
sudo rm -rf /usr/local/mysql *
My desktop on my mac is not working anymore. it can not even store files. can anyone help me? thank you very much
Post not yet marked as solved
where do I get free compiler?
how do I install it on my MacBook Air
?
Post not yet marked as solved
I try the command shown above in Terminal, I get a long response, ultimately stating that Modifications can only be made in Recovery Mode.
I boot up in recovery mode, try the command, it says command not found. Is there a workaround for this? Running Catalina if that helps. I also tried booting up using Command+R+S, which I understand puts me in single-user recovery mode. It appeared to have worked there, though I used two dashes instead of an en dash, and upon opening my Settings after rebooting, the command still had not worked.
Post not yet marked as solved
I'm opening a different thread to a question that was asked about a year ago.
I'm trying to get the output of "which" so that I can automatically find programs for the user. I've used the code that was provided in that thread which is:
func launch(tool: URL, arguments: [String], completionHandler: @escaping (Int32, Data) -> Void) throws {
let group = DispatchGroup()
let pipe = Pipe()
var standardOutData = Data()
group.enter()
let proc = Process()
proc.executableURL = tool
proc.arguments = arguments
proc.standardOutput = pipe.fileHandleForWriting
proc.terminationHandler = { _ in
proc.terminationHandler = nil
group.leave()
}
group.enter()
DispatchQueue.global().async {
// Doing long-running synchronous I/O on a global concurrent queue block
// is less than ideal, but I’ve convinced myself that it’s acceptable
// given the target ‘market’ for this code.
let data = pipe.fileHandleForReading.readDataToEndOfFile()
pipe.fileHandleForReading.closeFile()
DispatchQueue.main.async {
standardOutData = data
group.leave()
}
}
group.notify(queue: .main) {
completionHandler(proc.terminationStatus, standardOutData)
}
try proc.run()
// We have to close our reference to the write side of the pipe so that the
// termination of the child process triggers EOF on the read side.
pipe.fileHandleForWriting.closeFile()
}
it works fine for all of the normal command line routines but not for custom ones such as avr-gcc or any other that is installed via homebrew. I can use "which avr-gcc" in terminal and it shows the path just fine but in my app it returns nothing where as if I search for the path of something like ls in my app it returns it just fine.
What could be the cause of this?