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

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

Related

Xcode 10.0 Simulator error "Mach error -308 - (ipc/mig) server died"

Xcode Simulator won't boot. After running the project the simulator does not boot and the load bar is stuck at the end. Also it shows this error after I closed the simulator showing this error
The operation couldn’t be completed. (Mach error -308 - (ipc/mig) server died)
Any help is appreciated!
8 months ago the answer. This problem occurs when you install an alternative Xcode version like betas or previous versions. To solve this problem you need reinstall Xcode command line tools.
As there is no reinstall option in xcode-select command you need to remove the current command line tools as bellow:
sudo rm -rf /Library/Developer/CommandLineTools
Verify if xcode-select is the right path
xcode-select -p
The output is similar to:
/Applications/Xcode.app/Contents/Developer
Reinstall the command line tools
sudo xcode-select --install
Now you need to reboot the system.
After reboot your system you need to launch the Xcode. Son after the Xcode additional components will appear.
After concluding the installation your simulator works right.

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

Nativescript doesn't recognize Xcode (High Sierra)

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.

installing qt on macOS Sierra [duplicate]

I just installed Qt 5.5 and am using Qt Creator for the first time on OS X. When I first installed Qt, it gave me an error message 'Xcode 5 not installed' which I thought was strange, (I have the Xcode 7 beta), but the install completed successfully anyways.
Now, when I start or open a project, I get the error:
Project ERROR: Xcode not set up properly. You may need to confirm the license agreement by running /usr/bin/xcodebuild.
When I run /usr/bin/xcodebuild in Terminal, I get the following:
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
I'm not sure what Xcode has to do with Qt Creator, unless it has something to do with accessing libraries for cross-platform compatibility, but is there a way to fix this issue?
>= Xcode 8
In Xcode 8, as Bruce said, this happens when Qt tries to find xcrun when it should be looking for xcodebuild.
Open the file:
Qt_install_folder/5.7/clang_64/mkspecs/features/mac/default_pre.prf
Replace:
isEmpty($$list($$system("/usr/bin/xcrun -find xcrun 2>/dev/null")))
With:
isEmpty($$list($$system("/usr/bin/xcrun -find xcodebuild 2>/dev/null")))
~> Xcode 8
Before Xcode 8, this problem occurs when command line tools are installed after Xcode is installed. What happens is the Xcode-select developer directory gets pointed to /Library/Developer/CommandLineTools.
Point Xcode-select to the correct Xcode Developer directory with the command:
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
Confirm the license agreement with the command:
sudo xcodebuild -license
This will prompt you to read through the license agreement.
Enter agree to accept the terms.
If you change content of Qt_install_folder/5.7/clang_64/mkspecs/features/mac/default_pre.prf
then it will work only for Desktop kit, not for ex. simulator.
A better way is just to create symlink:
cd /Applications/Xcode.app/Contents/Developer/usr/bin/
sudo ln -s xcodebuild xcrun
so you don't have to change .prf files for all targets.
This will do the trick:
#sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
Run this in your terminal.
For users of Xcode 8, there is another problem. See here for a temporary solution until Qt 5.7.1 is released:
https://forum.qt.io/topic/71119/project-error-xcode-not-set-up-properly
To summarise:
Open Qt_install_folder/5.7/clang_64/mkspecs/features/mac/default_pre.prf in a text editor, and replace this:
isEmpty($$list($$system("/usr/bin/xcrun -find xcrun 2>/dev/null"))))
with this:
isEmpty($$list($$system("/usr/bin/xcrun -find xcodebuild 2>/dev/null")))
If you build Qt from source with XCode 8.x, you have to change the "-find" argument in the file qt-everywhere-enterprise-src-5.7.0/qtbase/configure on line 551 so that it looks like:
if ! /usr/bin/xcrun -find xcodebuild >/dev/null 2>&1; then
Managed to solve it installing the full version of Xcode, agreeing to the terms, then using xcode-select --reset.
Basically the problem is that the xcode you're pointing at /Library/Developer/CommandLineTools doesn't allow you to accept the terms & conditions. So after the install & resetting the location, all should be OK
For me, the only way to work correctly is to commenting the lines about xcrun with the '#':
# Make sure Xcode is set up properly
#isEmpty($$list($$system("/usr/bin/xcrun -find xcrun 2>/dev/null"))): \
#error("Xcode not set up properly. You may need to confirm the license agreement by running /usr/bin/xcodebuild.")
At the file: Qt_install_folder/5.7/clang_64/mkspecs/features/mac/default_pre.prf
Just to add a bit to a lot of old answers in the spirit of "This worked for me"
I found that by launching Xcode, logging in to my developer account (just a free one) and then setting the Command tools in "Locations".
I could get the
'sudo /usr/bin/xcodebuild -license agree'
to work. i.e. it launched an agree process in the command line and I agreed after careful reading of all 14 squillion pages of stuff.
I did not have to edit anything.
My system is Mojave 10.14.6 and Xcode 10.3 (10G8).

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