Nativescript doesn't recognize Xcode (High Sierra) - xcode

I'm on High Sierra with Xcode Version 9.0.1 (9A1004).
When running tns doctor I get the following warning:
WARNING: Xcode is not installed or is not configured properly.
You will not be able to build your projects for iOS or run them in the iOS Simulator.
To be able to build for iOS and run apps in the native emulator, verify that you have installed Xcode.
If I run the installation script, furthermore I get:
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
Xcode is not installed or not configured properly. Download, install, set it up and run this script again.
As you might have guessed, I have Xcode installed from the app store and I've also installed cocoapods and xcodeproj. This is the only warning that I get.
Any suggestions?

Run the following command:
sudo xcode-select --reset
I found this answer here:
http://overengineer.net/fixing-nativescript-s-xcode-is-not-installed-or-is-not-configured-properly-on-macos

I had this problem today, but running the recommended command didn't help. I found that running the command
$ tns doctor
walked me through a series of prompts and corrected the issue. I did have to restart my terminal after the program completed in order for it to take effect.

Open Xcode than go to Preferences -> Locations -> Command Line Tools after that it'll automatically take a path for the same. The system may ask for sudo password.

Related

Xcode 13 instruments is not a developer tool or in PATH (React native)

I recently upgraded to xcode13, before which react native app was working fine for long time. However, after switching when I run in iOS, I am getting error "instruments is not a developer tool or in PATH" on command "xcrun instruments". I tried following commands (all with Xcode in quit status)
sudo xcode-select -r
it reset the xcode select path to
/Applications/Xcode.app/Contents/Developer
then I quit command line reopened and tried
xcrun instruments
got same error again, so tried switching
sudo xcode-select -s /Library/Developer/CommandLineTools
quit command line and tried again, still no success. each time i verified path change using command
sudo xcode-select -p
I opened instruments app using cmd+space and could see version as 13, same as Xcode.
That means matching instruments app(tool) exists but somehow xcrun is unable to find it which results in build failure.
FYI my react native version is 0.64.0. I saw couple of solutions like comment out flipper (which was not in my pod file though!) and add swift to library path in project.pbxproj, both solutions could not be applied.
Any suggestions would help.
I've been getting the same error no matter what I've tried. I think there might be an error on setting the command line tools path with the Xcode version 13. So deleting XCode 13 (How to uninstall XCode) and reinstalling 12.5.1.(XCode12.5.1) solved the problem for me temporarily.
The solution is to upgrade to 0.64 incase creating RN builds with Xcode 13 as Instruments have been replaced with xctrace only in 0.64's RN cli 5.0.1 (upgrade RN Cli as well), reference : RN Github solution comment

Installing Xcode command line tools

I performed a fresh install of macOS Mojave 10.14. Immediately after that I installed Xcode Version 10.0 (10A255) from the Mac App Store.
Now, I wish to install Homebrew which requires Xcode command line tools to be installed. My understanding is that installing Xcode also installs the command line tools. Or not?
As per this answer, I checked if the command line tools are installed by running:
xcode-select -p
which printed the path for the Developer directory as follows:
/Applications/Xcode.app/Contents/Developer
As suggested in the answer, I also verified the return value by running:
echo $?
which retuned 0.
I also ran, gcc and make and bash was able to locate and execute them.
Thus far I am convinced that the Xcode command line tools are installed. Now when I execute:
xcode-select --install
I get this alert:
What's the probable reason for this disparity? Will this install Xcode command line tools twice? Or overwrite the existing installation?
As I understand, Xcode command line tools can be installed without installing Xcode. Also, from my previous experience, if the command line tools aren't installed separately from Xcode (by running xcode-select --install), they are not detected by Homebrew, i.e. when running brew config, the value for CLT: is shown as N/A.
Here's the complete picture (pardon the pun):
Although I am talking in context of macOS Mojave, the question remains the same with regard to previous versions of macOS.
What is the advisable approach to take here?
Note: After installing Xcode, I launched it, accepted license agreement and let it finish its run of installing additional tools (which is a one time activity).
Following worked for me, only command line tool can also me installed.
After you updated to Mojave 10.14 Go to https://developer.apple.com/download/more/ search for "command line" then
Download "Command line tool for MacOS 10.14"
Once dmg is downloaded install the package.
Verify package installation

XCode prerequisite version check failed? Unable to package app with Intune Packager

Edit: It appears the latest Release Notes from Apple indicate massive changes with the build system. Currently, Intune's Package Manager hasn't been recently updated, so I don't expect a fix besides downgrading until update.
I just updated XCode and OSX and ran the Intune MAM packager as always, but now instead of succeeding, I get this:
Version of MACOSX is 10.13.5
XCode prerequisite version check failed: failure in executing the xcodebuild command.
Missing prerequisite.
Cause of the error to be provided for investigation:Error Domain=IntuneAppPackager Code=22 "XCode version 5 or greater is required to run this tool." UserInfo={NSLocalizedDescription=XCode version 5 or greater is required to run this tool.}
I already had to re-enable certs to match the profile, but this seems unrelated. I have the latest XCode and the build tools installed via default settings. I googled different parts of this error and nothing came back. This could be InTune's mam packager but the error itself is relatively specific in saying XCode Build tools.
Try this code in your terminal:
xcode-select -p, then check if that path is correct path of your Xcode.
If this doesn't work, try this code:
sudo xcode-select --switch /correct path of the xcode app.
For example:
sudo xcode-select --switch /Applications/Xcode_7.3.1.app/Contents/Developer
This is what I did, and it works!
I have Xcode installed via App Store and came across the same error after switching to a new version of Intune MAM Packager.
sudo xcode-select --switch /Applications/Xcode_7.3.1.app/Contents/Developer
That worked for me

How to continue using Git on mac after uninstalling Xcode (with Android Studio)?

I have installed Git on my Mac. When I do a "whereis" in my terminal the route is:
/usr/bin/git
I use Android Studio and the GitHub desktop client and had no problems so far.
Previously I had installed Xcode, but I uninstalled it a week ago. Since then, Android Studio does not detect Git, I get the following error:
xcrun: error: active developer path
("/Volumes/Vega/Applications/Xcode.app/Contents/Developer") does not
exist, use xcode-select --switch path/to/Xcode.app to specify the
Xcode that you wish to use for command line developer tools (or see
man xcode-select)
Android Studio shows the same executable path to Git
indicating the terminal (/usr/bin/git), but when I click on the "test" button it displays the same error.
I do not handle very well Git from the terminal, always use the desktop client.
What do I have to do to continue using Git on my Android studio (or anywhere) now that I uninstalled Xcode?
I searched for information but I can not fix it.
If commands sudo xcode-select --reset and xcode-select --install does not work for you and you dont want to install xcode then just reinstall git manually via brew:
brew reinstall git
And open new terminal session
Worked for me
sudo xcode-select --reset
Will reset your paths to the defaults if the command line tools are already installed.
You should install the Xcode command line tools at the very least. If you're not a registered Apple Developer, however, I'm not sure how to get hold of them if Xcode is not installed. If you are a registered Apple Developer, you can get them from the Apple Developer Download site. It' probably best to re-install Xcode and you will get them as a system update.
That will give you a minimal development environment, and if you need additional tools/libraries you can build them via Macports with the command line tools installed.
Try this :
xcode-select --install

xcode simulator is installed but isn't available from terminal

I've installed xcode Version 5.1.1 (5B1008), and I've installed command line tools using xcode-select --install. I can check it using xcode-select -p.
but when I call simulator from terminal I get the error "XCode not installed." why?
note: I'm using AppGyver Steroids and I call simulator while working with it.
Since I didn't get any help on this, I removed the Xcode and installed it again and it worked properly. this won't be the best way, but at least solved the issue.

Resources