Xed - Open Files in Xcode Editor

Use the Xed command-line tool to easily open files for editing directly in Xcode. Supports creating new files and jumping to specific lines.

Xed - Command-Line Tool for Xcode

Introduction to Xed

The xed command-line tool is a convenient utility for macOS developers that allows you to open files directly within the Xcode IDE from your terminal. This tool streamlines the workflow by enabling quick access to project files without needing to navigate through the Xcode interface manually. It's particularly useful for quickly editing configuration files, source code, or any other file associated with your Xcode projects.

Core Functionality

The primary function of xed is to launch Xcode and open a specified file. This is achieved with a simple command structure, making it an intuitive addition to your development toolkit.

Usage Examples

Here are some common ways to use the xed command:

Opening a File

To open a single file in Xcode, use the following syntax:

# xed
# Opens files for editing in XCode.

# Open file in XCode
xed ${filename}

Creating and Opening New Files

If the file does not exist, xed can create it for you and then open it in Xcode. Use the -c flag for this purpose:

# Open file(s) in XCode, create if it doesn't exist:
xed -c ${filename}

Opening to a Specific Line Number

For faster navigation within larger files, you can specify a line number to jump to. Use the -l flag followed by the line number:

# Open a file in XCode and jump to line number 75:
xed -l 75 ${filename}

Benefits of Using Xed

  • Efficiency: Quickly access and edit files without leaving the terminal.
  • Workflow Integration: Seamlessly integrates with your existing command-line development workflow.
  • Convenience: Easily create new files or jump to specific lines for targeted editing.

External Resources