App name does not exist in Instruments dSYM Locations - xcode

I'm trying to re-symbolize my project in instruments since it's not showing functions name under TimeProfiler. But I'm not able to find my App under the dSYM Locations.

I don't know why, but for some reason the profiling schema under xcode had 'release' config instead of 'debug'!! changing that back to debug solved the problem.

This is a bug with spotlight and Lion.
Unfortunately "mdimport ." command does not work in all situations ( this command should tell where to look for the dsym files, if you were in the dsym folder it must work)
So i end up locating manually in instruments the files under: /Users/YOUR_USER_HERE/Library/Developer/Xcode/DerivedData/YOUR_APP_HERE/Build/Products and then select the appropriate folder and DSym files.
To be able to select Library folder you need to write this command: chflags nohidden ~/Library/

Related

How to symbolicate for Xamarin.iOS on Windows

I submitted an iOS app which failed review due to a crash. I was given the crash report which unfortunately for me, was useless because I didn't keep the dSYM files and .app file that I apparently needed to decipher the crash report.
First question -
I've built a new release and I've stored the dSYMs folder away for safe keeping, but I can't find the .app file that I apparently need. this link here suggested that I could change the .ipa file to a zip and then get the .app from unzipping it but there was nothing in the zipped folder once I changed its extension to .zip How to symbolicate crash/error logs from a Xamarin Forms iOS project?
Second question - How do I symbolicate on windows? I've seen guides like this one, but it only shows you how to do it on a MAC. The problem I have is that the project is entirely built on my windows machine which is networked to a MAC. https://jmillerdev.com/symbolicating-ios-crash-files-xamarin-ios/
I was able to symbolicate the crash reports given by apple from the review by using this guide:
https://jmillerdev.com/symbolicating-ios-crash-files-xamarin-ios/
or
How to symbolicate crash/error logs from a Xamarin Forms iOS project?
Basically what you need to do:
Get the .dSYM and .app file from the archived release folder and put it on your MAC in a folder some where. Additionally, put the crash report in the same folder. (The crash report on App Store Connect will be a .txt file. Change it to .crash) Open up the terminal and change the current working directory to that folder I just mentioned. e.g. cd /Applications/crashFolder
Run the following terminal commands
alias symbolicate="/Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework/Versions/A/Resources/symbolicatecrash -v"
export DEVELOPER_DIR="/Applications/Xcode.app/Contents/Developer"
Symbolicate your .crash file with this terminal command:
symbolicate -o "symbolicatedCrash1.txt" "crash1.crash" "MyApp.app"

xcode command line app - where is the executable code?

I'm writing a small command line tool/app in Xcode 6. After a steep learning curve (that I'm still climbing) I've got my code working in main.m without errors. My question is: does Xcode build some executable code that I can run from the command line inside a Terminal? I've tried "Build" and "Run & Build" but I don't see where any executable code is created. I'm very new at Xcode and need some help. I'm running OS X 10.9.5 and Xcode 6.1.1 on a Mac Mini.
If viewing my code would be useful, let me know and I'll put it up.
Thanks for any assistance.
Kevin H.
It's hidden very well. In Xcode 6, when you build an app, there is a folder "Products" in the project navigator (left pane). The name of your project will be there too. Right click, and select "show in finder". It will show you an obscure folder hidden deep in your OS X Library where the executable is located.
To copy the executable to a more convenient location each time you compile go into the project settings and select the Build Phase.
Type in a absolute location such as: ~/Documents/dev/temp. (It does recognize ~ as the current users home directory)
Then Press the '+' Button Under the 'Copy Files' Section and Select Your File (Select Your executable under the Products Folder)
Deselect the 'Copy only when installing' button. Then build and it should be at that location.
To launch just open the terminal app and go to that location. The executable should run unless there are dynamic libraries it calls that are not in the lib path.
Hope this helps
The binary is in a folder under /Users/Username/Library.
Something like:
/Users/<Username>/Library//Developer/Xcode/DerivedData/.../Build/Products/Debug/<ProjectName>
You can easily find it with this command:
find /Users/<Username>/Library/ -name "<ProjectName>"
replace "Username" and "ProjectName" accordingly to reflect your environment.
"Find" works, but you could also view the build log output and look for "CreateBuildDirectory" and copy the path from there.
Example below:
In Xcode 14 the path is nested under the line that says "Create build directory $(DERIVED_DATA_DIR)", but you can see the full path by expanding the icon on the right of the output.

Is there any way to disable write-access to source code from within Xcode?

Is there any easy solution to prevent Xcode from writing to source files in a project? I want to edit source files externally and only use Xcode for debugging and so I want to prevent any accidental modifications getting saved via xcode. (Obviously I want Xcode to pickup external changes to files when I build/debug)
One possible solution that I thought of was to enable app sandbox entitlements on xcode and manually maintain a list of directories that it should not write to. Is this feasible? Any other ideas?
On the sandboxing thing, I'm not sure if Xcode is disqualified as per Apple's Sandboxing Requirements.
I don't think there's any way to prevent XCode from getting all into your source, writing temp files and whatnot.
One option would be to create a simple shell script that pushes your source to a directory for XCode to use. Since you're not using XCode for development (debugging only), just copy your entire project tree into a temporary directory and then open that in XCode.
Something like (push_to_xcode.sh):
#!/bin/bash
#first, wipe existing project from your temp directory
rm -rf /tmp/xcode_temp_code
#then, copy your existing project into the temp folder
cp -R /path/to/your/project/myProject /tmp/xcode_temp_code
#lastly, launch the project
open /tmp/xcode_temp_code/myProject.xcodeproj
Once you've created the script, change it to executable by typing chmod +x push_to_xcode.sh
Then open a terminal, cd to the directory where you saved the script, and type ./push_to_xcode.sh or double click on it in finder.
That will launch Xcode with this project. No changes you make in XCode, either purposefully or accidentally, will affect your original code.

Where does xcode resolve "$(BUILT_PRODUCTS_DIR) to on my system?

When Compiling for iPhone Simulator with Xcode 4.2, if I place
"$(BUILT_PRODUCTS_DIR)"
in
Build Settings / Header search paths / Debug
and exit editing I can see it resolves to:
"build/Debug-iphoneos"
Where should this be on my system? I have looked in:
Library/Developer/Xcode/DerivedData/{Project Name}/Build
but I can't find a file called build that contains a folder called Debug-iphoneos.
On my system, compiling an OSX project, that resolves to an absolute path:
BUILT_PRODUCTS_DIR /Users/andy/Source/MyProject/build/Debug
There are so many Xcode build variables that I keep a text file with a sample list of them which I got from executing a custom build script and viewing the output within the log tab.
If your code is going into the Library folder, then that is hidden under Lion. You can unhide it from the command line (Terminal) using:
$ cd ~
$ chflags nohidden Library
You should then be able to see its content.
Another tip: I have a ~/tmp folder where I let temporary stuff accumulate and I have set my Xcode preferences to put DerivedData and Archives into that folder so I can:
delete it now and again (I don't like temporary stuff accumulating where I cannot control it).
see it for packaging pre-release Archived project to testers.

Symbolicate crash file with dSYM and .ipa file

Is there any concreate way to symbolicate crash logs from my app, i have following things
dSYM file
.ipa Application file
myapp.crash
-
I have tried symbolicatecrash script but it does not work somehow
Xcode does not work also i have Xcode 4.3
I even tried system 'atos' command but it gives me some c or c++ file
I dont have build file in my archive is it because of that, because app was build in different machine ?
This may be too late.. but i saw the method in another link that i am now trying to find :P
Rename your .ipa file to .zip
Open the zip file to extract the app
now run symbolicatecrash script or delete the .symbolicated folder
and restart xcode
if not helpful to you, hope this helps others.
Edit: found the place Symbolicating iPhone App Crash Reports
Aside from xcode's tools, you can use atos: https://stackoverflow.com/a/4954949/312725
Be sure to take slide into account as well: https://stackoverflow.com/a/13576028/312725

Resources