Trying to get symbols for an iOS .crash file - xcode

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

Related

during install pod i am getting this error

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

Any way to stop Xcode from generating folders like this?

I was trying to build GMP on OS X, and it fails with the following error:
/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/Cleanup: No such file or directory
The problem is due to this command:
/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/Cleanup At Startup/SMSandboxTools-tmp/Applications/Xcode.app/Contents/Developer/usr/bin/make all-recursive
Someone isn't parsing the directory name properly. Does anyone know how to prevent Xcode from generating folders with spaces in the names?
You can't prevent Clean at Startup from being generated.
Your build script could either escape the spaces, or simply put the whole path in quotes. For example, this doesn't work:
$ cd /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/Cleanup At Startup
But this does:
$ cd "/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/Cleanup At Startup"
If you don't want to fix the script yourself, I would just open an issue with the GMP developers.
My installation was botched. (Cleanup at Startup sounds an awful lot like something the OS leaves around for dealing with after an update... and I did have an update with issues.) I'm guessing Apple's developers have encountered this before, as the Xcode manual for the command line tools has the following:
The Command Line Developer tools package has been updated to include xcrun. xcrun adds support for the following:
1. The --show-sdk-path option queries SDK paths
Invoking xcrun --show-sdk-path gave the nasty, ugly path with Cleanup at Startup. On the same help page is this:
On OS X Mavericks, xcode-select provides the --reset flag to revert to using the default search paths.
I invoked xcode-select --reset, and that fixed my problem! GMP built smoothly, and xcrun --show-sdk-path now displays nothing... which seems weird, except that, as I say, gmp ran, tested 100% correct, and installed.

-bash : rvictl: command not found, Mac book pro OS X 10.7.5 & Xcode 4.6

I want to debug some network bug with my application ,I found a way to create rvi to trace, But I even can't finish step 1 :
rvictl -s
-bash : rvictl: command not found
what should I do ?
I follow the site:
https://developer.apple.com/library/mac/qa/qa1176/_index.html
help! thanks
Mavericks and beyond: You need to install XCode from the App Store, and then you need to launch XCode once, and accept installation of additional tools. Restart your terminal. Good to go.
I found the solution here.
In summary, the link above explains that the issue may stem from installing Xcode without installing the additional components.
Check rvictl is installed by looking for the /usr/bin/rvictl folder. If it does not exist, then rvictl is not installed. To install the packages, open your application folder through finder, right click on the Xcode app, and follow the path below to find the items which need to be installed manually:
Xcode.app/Contents/Resources/Packages/MobileDevice.pkg
Xcode.app/Contents/Resources/Packages/MobileDeviceDevelopment.pkg
Restart your terminal and.... Voila !! it should work now.
CATALINA UPDATE.
Based #KarthicRaghupathi's comments. the rvictl location was changed in Catalina. The rvictl file is now located at /Library/Apple/usr/bin.
The rest of the process stays the same as above.
I'm using macOS Catalina and Xcode 11, Could able to find rvictl file in /Library/Apple/usr/bin. but still got the same error
-bash : rvictl: command not found
Tried all provided solution nothing worked for me. Adding sudo saved me,
sudo rvictl -s [DEVICE UDID]
[or]
sudo /Library/Apple/usr/bin/rvictl -s [DEVICE UDID]
This may help some one.
You need to install the Command Line Tools for Xcode, available here:
https://developer.apple.com/downloads/index.action?name=for%20Xcode%20-#
That includes the rvictl program.
It seems like default location and installed location of rvictl on Catalina are different.
rvictl should be installed by Xcode. Look for it at path: /Library/Apple/usr/bin/rvictl. The default shell has /Library/Apple/usr/bin/ in its path, either customise it or provide full qualified path i.e
/Library/Apple/usr/bin/rvictl -s 00008020-XXXXXXXXXXXXXXXX
Source: https://forums.developer.apple.com/message/392193#392193
When you say: the command line tools for 10.10 apparently do not include the rvictl program - I get the error message: command not found
You need to see the comment above: Mavericks and beyond: You need to install XCode from the App Store, and then you need to launch XCode once, and accept installation of additional tools. Restart your terminal.
It will then appear.

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/.

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