during install pod i am getting this error - xcode

Failed to extract git version from git --version. Instead I see:
xcrun: error: active developer path ("/Users/mcbook/Downloads/Xcode.app/Contents/Developer") does not exist
Use `sudo xcode-select --switch path/to/Xcode.app` to specify the Xcode that you wish to use for command line developer tools, or use `xcode-select --install` to install the standalone command line developer tools.
See `man xcode-select` for more details.

Like all macOS apps, the Xcode app is represented in the file system as a folder, even though in Finder we see it as an icon.
In Xcode’s case its main app folder contains subdirectories that include some command line development tools that are necessary when installing apps that need to be compiled.
When you first run Xcode, it registers the location of this subfolder for you. Unfortunately, it looks like you first ran Xcode when it was still sitting in your Downloads folder, and so all your command line tools are still looking for it there.
I’m assuming that in the mean time you’ve moved Xcode – which, as you’d expect, moves all the application folder’s files and subfolders as well – to your /Applications folder.
You should be able to redirect all your tools to look in the new, correct location by using the following command line command:
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

Related

Install .tar.gz on MAC

I failed to understand the INSTALL.md file. I know few programming knowledge. I appreciate anyone can give me a thorough explanation or instruction.
The software I wanna install is https://sourceforge.net/projects/scidavis/
Information in INSTALL.md
Mac OS X - MacPorts instructions
These notes refer to use MacPorts. Using other build environments such
as HomeBrew is presumably equally as viable, but you may need to hack
the config files a bit.
Install MacPorts.
Install XCode and XCode command line
tools
If you want to be able to run your build on an earlier version of
MacOSX than your build machine, see How to build a Macintosh
executable that will run on older versions of
MacOSX.
Install the prerequisites for scidavis.
port install qt4-mac qwt52 qwtplot3d boost gsl py27-pyqt4 py-pyqwt py27-sip muparser
Sadly, you may need to do this step multiple times before eveything
is installed
link sip-2.7 share directory to where sip expects it to be:
ln -sf /opt/local/Library/Frameworks/Python.framework/Versions/2.7/share/sip /opt/local/share/py27-sip
Add qt's bin directory to your PATH
PATH=/opt/local/bin:/opt/local/libexec/qt4/bin:$PATH
Configure scidavis
qmake CONFIG+=osx_dist
Build scidavis
make qmake
make
Create the installable package
sh mkMacDist.sh
Thanks in advance
If you are trying to install a tar.gz files you must first run gunzip on the file. gunzip filename. This should give you a .tar file. To open the tar file run: tar -x filename.tar.
NOTE: if you're trying to install a unix executable, it's sometimes easier to use homebrew. Search the internet for the application you're trying to install and the term homebrew, and it might bring up a page on homebrew and give you a simple install command which you can run in the mac terminal.
Steps to install tar.gz on macOS
Double click it the tar.gz file open it
Its contents (e.g. directories/files it contained) should appear in the same directory the tar.gz file is in (to prevent clutter, consider placing the tar.gz file in a new, empty directory before double clicking on it)
One of the new files might be a unix executable that looks like this:
Open another finder window (command + n), navigate to this location /usr/local/bin, and place the executable file you found in the previous step in this new location (you can do this using the mac terminal if you prefer - here's a random example showing show)
At this point, open a new terminal tab, and type the name of the program (the file you moved in steps 4), terminal should recognise the program. However, if you see this there is one more step:
Go to System Preferences -> Security & Privacy -> General tab. Click the lock icon, type password if it asks for it, and then click on 'Allow'.

Trouble getting root to build

I am currently trying to learn root for my research team and getting installed on my mac. I have been following the instructions detailed at this website and hit a snag. I've successfully installed the root package and command line tools, as well as assigned ownership of the folder to my user, however whenever I try to run
./configure
it gives the following error report:
Checking for Xcode OSX SDK ... no
configure: no Xcode OSX SDK found at /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk
Run xcode-select to update the developer directory path
or make sure the desired SDK version is installed
After re-downloading Xcode and the command line tools, I've hit an impasse. The folder is obviously there, albeit seemingly as an alias (as can be seen here) despite not being that before I started writing this and running
xcode-select -s '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk'
it only responds with:
invalid developer directory '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs'
Anything you can tell me to get this going will be a great help.

Where does xcode-select store information

I am writing a tool, that runs clang from Xcode path. This tool gets location of Xcode by running /usr/bin/xcode-select, but I want to remake it so that it reads Xcode location directly from disk instead of running xcode-select. I tried to debug xcode-select (which is a symlink to xcrun), but didn't manage to find how it stores/reads location of Xcode (does it stores it in environment or files?). If you know how to get location of Xcode without running xcode-select (and xcrun), please help! Thanks in advance!
As of Xcode 6, the location is a symlink at /var/db/xcode_select_link. You can output the target of the link to your terminal with the command readlink /var/db/xcode_select_link. If there is no link (eg, you run xcode-select --reset), the default xcode installation is used.
With NSWorkspace you can do a:
[NSWorkspace sharedWorkspace]fullPathForApplication:#"Xcode"];
which returns /Applications/Xcode.app when it's installed in the default location.
// …or, as I have seen in the documentation, there's also
- (NSURL *)URLForApplicationWithBundleIdentifier:(NSString *)bundleIdentifier
// which returns the URL for the application with the specified identifier.
Used dtruss command to print all open syscalls of xcode-select.
dtruss -f -t open xcode-select -print-path
Found at, that it tries to read /usr/share/xcode-select/xcode_dir_path and get Xcode location from there. If it does not exist, it takes the default Xcode location, which is /Applications/Xcode.app/.

Trying to get symbols for an iOS .crash file

I'm stumped on how to get symbols for a .crash file out of xcode.
I have the .crash file, the .app file, the .ipa file and the .dSYM file. I drag the crash log into the xcode organizer and I see the crash log with symbols for system calls, but no symbols for my app.
The .app/.ipa was built by our build machine, so it was not archived via xcode.
I tried placing all three files (well, two are actually directories but look like files to the Mac) in the same folder and nothing. I tried running symbolicatecrash from the command line while in that directory and I get this error:
Error: "DEVELOPER_DIR" is not defined at /Applications/Xcode.app/[snip]Resources/symbolicatecrash line 53.
I tried setting DEVELOPER_DIR to /Applications/Xcode.app and it gets further, but now I see a slew of errors that read:
sh: /Applications/Xcode.app/usr/bin/xcrun: No such file or directory
I'm stumped. You'd think this would be easier given all 4 needed files are in same directory.
I am running xcode 4.4, but was experiencing the same issues last night with 4.3. I was hope upgrading would help.
Make sure you set the right DEVELOPER_DIR:
export DEVELOPER_DIR="/Applications/Xcode.app/Contents/Developer"
Xcode is written with capital X. Tested on Mountain Lion (10.8).
First set correct Xcode location:
sudo /usr/bin/xcode-select -switch /Applications/Xcode.app/Contents/Developer/
I set this variable and got it working.
export DEVELOPER_DIR=/Applications/Xcode.app
Then and I ran the symbolicatecrash in this directory:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/PrivateFrameworks/DTDeviceKit.framework/Versions/A/Resources
(Sorry my answer was written before properly reading your question).
Use xcode-select to set the correct location of your Xcode install. More precisely:
$ sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

xcodebuild and C standard library

I have a xcode project that was created for osx snow leopard. All it was required to be built was to run
xcodebuild
from the command prompt. I am now trying to build the same project on OS X 10.7 and the following error happens when I run the same command
/Users/repo/trunk/main.c:31:10: fatal error: 'stdlib.h' file not found
What exactly is going on? I tried to follow the instructions from this question but stdlib.h is still missing.
How can I fix this problem?
Likely you are getting bit by the repackaging of everything inside /Applications/Xcode.app starting with Xcode 4.3. In Unix-like installations stdlib.h usually lives in /usr/include and your project likely expects it to be there as it was pre-Xcode 4.3. You can fix this by installing the command line tools, which includes the tools and the associated headers and libraries in their standard location.
The easiest way to install the command line tools is from inside Xcode. In the Xcode Preferences select the "Downloads" pane and then the "Components" tab. Push the "Install" button next to "Command Line Tools".
You need to run xcode-select to tell xcodebuild and xcrun which Xcode you want to use.
See this manpage.

Resources