If I have any file open in Xcode and I would like to know the complete path to the file, how do I do that in Xcode 4? In Xcode 3 I could hover over the file name and get a tooltip with the complete path. I could also right-click a file name at the very top and get a pop-up window with the complete path. This is all gone in Xcode 4.
The annoyance is that when using the Xcode 4 search, it doesn't even show the complete path of the file in the results?!
The only solution I have currently found is to open the save as dialog and get the path from there! That definitely can't be the solution. What am I missing?
For files that are not part of the project you can use the File menu's Show in Finder option.
Update: Xcode 4.2 restored the ability to right-click or command-click on the file's name in the title bar to get a drop-down with the full path.
Show the file inspector utility (normally at the right hand side of the main window on my setup , to do that click the rightmost button of the "View" buttons menu). Click on your file in the navigator and the inspector will refresh with the information. Full path is disclosed and there is a button to open a new Finder window with the enclosing folder.
Related
Just downloaded Xcode 10.1. I have Preferences->Navigation->Double Click Navigation set to 'Uses Seperate Window' as I usually do. However double clicking any file in the project opens a window but the contents of that window is the wrong file. Whichever file I double click on, the same incorrect file opens. If I change double clicking to open in a tab, the correct file is opened...
The problem appears to be just one project.
Have tried a 'Clean Build Folder' to no avail
It was working fine in 10.0
I open the project using the xxxx.xcworkspace (as I have pods in the project).
If I open a new window and view a specific file there then go back to my window with the list of files and double click that file, the correct window is brought to the front with the correct file visible.
Same here. For me it's the Readme.md file that is added at the top level of the project (not inside a group). Removing the reference from the project or putting the top level file(s) in a group (folder) fixed the issue.
I'm using Perforce for managing our code base. In Perforce, we need to check out a file before we can edit it. When I'm working in Xcode, sometimes I want to know the full path to the working file so that I can check it out in Perforce.
So here is my question:
Is there a shortcut, plugin or some other quick way to copy the full path of a file in Xcode?
What I have known:
I can Command+click on the file tile to show up the full path, but I cannot copy it.
In Visual Studio, we can right click on the file's tab and choose Copy Full Path to achieve this.
In Eclipse, we can Alt/Option + Enter to achieve this.
Update:
Actually my question is about how to achieve the equivalent Copy Full Path feature inside Xcode. Anyway, dragging the file to the terminal is also a very nice workaround.
You can copy it directly out of the File Inspector. The first section ("Identity and Type") of the File Inspector shows information about the selected file, or the file that contains the selected symbol, etc. You have Name, Type, Location, and Full Path. You can select the full path and copy it.
As a shortcut, a triple click on any part of the path will select the entire path. There's also a small icon with a light arrow on a dark background -- clicking that will open a Finder window with the file selected.
You can drag it to a terminal... Easy and fast...
on your editor XCode (you want to get the file path). Press:
Command+Shift+J
xcode will open directory file path on Project Navigator (left side bar)
and then drag-and-drop file from Project Navigator to the terminal. it will give you the directory of the file.
You can use find command to copy file path:
cd myProject
find . -name myCodeFile.cpp
Extending Caleb's answer, here is a graphical demo:
Steps:
Select a filename on the Project navigator from the left side Navigator panel.
Tap on Show File Inspector from the right side Inspectors panel. (marked with red box)
Copy the path from there. (marked with a bigger red box)
I tried to rearrange my source code files in finder and now xcode shows them as deleted. Is there a way to tell xcode the new location of the file?
Click on the Missing file (turns Red) and go to file inspector. Click on the folder button in file inspector and provide the correct path of the file.
For missing files like this in red.
set correct path as shown below.
Select the file in the left (navigator) panel. In Xcode open the right (Utilities) panel if it's not already open. Now click the "File Inspector" tab. You should see a part that says "Location" with a button that looks like a folder. Click that button and then navigate to the folder where you moved the files to. Bam! Xcode should now see it's there!
How do I find the location of a file opened by xcode?
Right-click (or Control + left-click) anywhere in the document that you want to find (or on its entry in the project navigator pane on the left), and select the "Show in Finder" option. Works in XCode4, at least.
In Xcode 3, I used to select a file, and press command-I to view the file's property. I frequently have files missing, and hence this will show me the path to the file to fix.
In Xcode 4, command-I no longer works. What can I do?
The new shortcut is Option-Command-1 to show the file inspector.
If the file is missing, you can click on the icon at Location section to re-reference the file.
The only way I could get to it now is select the file, right click, "Open in Finder", then command-I.
The other option is try to see if "File Inspector" in the Utilities sidebar would give you enough information.