> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rork.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Open your project in Xcode

> An optional workflow for developers who want to export a Rork iPhone app through GitHub and build or debug it locally on a Mac.

> [!NOTE]
>
> You can [test your app in the Rork simulator](https://docs.rork.com/features/simulator.md), [run it on your iPhone](https://docs.rork.com/rork-max-swift.md), and [publish to the App Store through Rork](https://docs.rork.com/store-guides/publish-app-store.md) without opening Xcode. Follow this guide only if you want to work with the exported Swift project on your own Mac.

## When to use Xcode

Use Xcode when you or a developer want to step through the Swift code, debug on a connected device, or build and archive the app manually. Start by [syncing your project with GitHub](https://docs.rork.com/tutorials/how-to-connect-github.md).

**Requirements**

* A Mac
* Xcode installed
* Your project connected to GitHub
* GitHub Desktop installed (or `git` in the terminal)
* An Apple Developer account

### Installing Xcode

Download Xcode from the App Store

![Image](https://mintcdn.com/rork/DPzJFF7dKqS_bOmg/images/image-17.png?fit=max\&auto=format\&n=DPzJFF7dKqS_bOmg\&q=85\&s=6f6e717440f5f2652740d15b0f241dd7)

Then install the command line tools and accept the license:

```shellscript theme={null}
xcode-select --install
sudo xcodebuild -license accept
```

### Opening your Rork project in Xcode

Rork iPhone apps are native Swift projects, so Xcode opens them directly. There is nothing to generate first.

Connect to GitHub

![Image](https://mintcdn.com/rork/oINa1i0U8SpywlVs/images/image-15.png?fit=max\&auto=format\&n=oINa1i0U8SpywlVs\&q=85\&s=1080390d67b975b90a7cd585c1bdf180)

Go to GitHub

![Image](https://mintcdn.com/rork/oINa1i0U8SpywlVs/images/image-18.png?fit=max\&auto=format\&n=oINa1i0U8SpywlVs\&q=85\&s=4903d4bca2b2d3ad3078429d34e77769)

Open with GitHub Desktop

![Image](https://mintcdn.com/rork/oINa1i0U8SpywlVs/images/image-19.png?fit=max\&auto=format\&n=oINa1i0U8SpywlVs\&q=85\&s=668d1ecbbf17c682f99f899517d9e937)

Now open a terminal in the project folder and run:

```shellscript theme={null}
xed .
```

Your project opens in Xcode. If your project holds more than one app, run the command inside the iOS app folder.

Xcode resolves the Swift packages your app uses on the first open. Wait for that to finish before you build.

### Run the app

* **Simulator:** pick a simulator in the toolbar and press the play button.
* **Your own iPhone:** plug it in, select it in the toolbar, then press play. Your device needs Developer Mode, under **Settings → Privacy & Security → Developer Mode**.

Open the debug console at the bottom of the window to read the logs while the app runs.

### Publish to the App Store (via TestFlight)

Navigate to "Product" and click "Archive."

![Image](https://mintcdn.com/rork/oINa1i0U8SpywlVs/images/image-21.png?fit=max\&auto=format\&n=oINa1i0U8SpywlVs\&q=85\&s=08f19d39d0e3513235906419052b1cca)

When the archive finishes, the Organizer opens. Choose **Distribute App**, then **App Store Connect**, and your build appears in TestFlight.

## Troubleshooting

**The build fails right after opening the project.** Xcode may still be resolving Swift packages. Wait for it to finish, then build again.

**A Swift package fails to resolve.** In Xcode, choose **File → Packages → Reset Package Caches**, then build again.

**Stale build errors that make no sense.** Clean the build folder with **Product → Clean Build Folder** (Shift + Command + K), then build again.

**Signing errors.** Open the project settings, select the target, then **Signing & Capabilities**, and pick your Apple Developer team.

Build your app with Rork today.

Ship iOS, Android, and web apps by chatting with AI.

[Try Rork for Free](https://rork.com?utm_source=docs\&utm_medium=referral\&utm_campaign=docs-cta\&utm_content=cta-banner)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.