Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Copy file full path in Xcode

Tags:

xcode

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:

  1. I can Command+click on the file tile to show up the full path, but I cannot copy it.
  2. In Visual Studio, we can right click on the file's tab and choose Copy Full Path to achieve this.
  3. 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.

like image 570
hackjutsu Avatar asked Oct 29 '15 00:10

hackjutsu


1 Answers

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.

like image 104
Caleb Avatar answered Sep 20 '22 17:09

Caleb