Issue #985

During GitHub Universe 2024, GitHub announced that GitHub Copilot code completion in Xcode is available in public preview. The project is open source at CopilotForXcode

image

GitHub Copilot has been available as VS Code extension for a while, but this is first time we have official extension for Xcode.

GitHub Copilot for Xcode supports multiple programming languages commonly used in the Apple ecosystem, including Swift and Objective-C

Here’s how to use this new extension in Xcode. I’m using Xcode 16 on macOS Sequoia. You can download latest Xcode from xcodereleases

Setting Up GitHub Copilot in Xcode

1. Download

Head over to release to download GitHubCopilotForXcode.dmg

Once downloaded, open and extract the file. Essentially you can drag GitHub Copilot for Xcode to Applications folder

2. Install

  • Open the folder where you extracted the file.
  • Double-click CopilotForXcode.app.
  • If prompted by a security alert, click Open.

Follow the installation prompts. The Copilot icon will also appear in your menu bar.

3. Login to GitHub

Authenticate with your GitHub account to use Copilot.

You need to have a Copilot license to get access to Copilot for Xcode. All Copilot individual, business, and enterprise users have access to the public beta

CleanShot 2024-11-01 at 10 43 29@2x

Once authenticated on GitHub, you will receive this message

4. Permission

Copilot needs Accessibility permission and Xcode Source Editor extension to work.

To grant Accessibility permission, simply click on Accessibility Permission in the GitHub Copilot extension for Xcode app, it will opens System Settings app with the correct Accessibility pages opened.

CleanShot 2024-11-01 at 10 46 17@2x

To grant Xcode Source Editor extension, click on Extension Permission, it will open System Settings with page Login Items & Extensions

CleanShot 2024-11-01 at 10 47 59@2x

While on the Login Items & Extensions we can also allow Copilot extension to be launched at login, if it isn’t already turned on.

CleanShot 2024-11-01 at 10 49 44@2x

Using Copilot in Xcode

After granting Xcode Source Editor extension for Copilot, we should restart Xcode to apply the changes.

We should see Copilot in Xcode -> Editor menu

Start typing something, and press Tab to expand suggestions

Single-line suggestions appear by default, but if multi-line suggestions are offered, you can view and accept the entire suggestion by holding the Option key and pressing Option + Tab