ChatGPT wrote Swift code for my app. How do I get it on my iPhone?

Swift code from a chat is not an app yet. It still needs a project, a build with Apple's tools and a signature. The three routes to your iPhone, compared.

By Sigsten Gustavii· · 11 min read

Build your own water tracker with Borel

Build this app

You asked ChatGPT for an app, and it answered with a few hundred lines of Swift. It looks finished. Then you notice there is no button anywhere that turns the text in the chat into an icon on your phone. That gap is not about the quality of the code. An iPhone does not run text, and getting from one to the other takes three more steps.

This guide explains what the code still needs, in plain words, then goes through each realistic route to your iPhone: a Mac with Xcode, an iPad with Swift Playground, and a service that does the building for you, with where Borel fits and where it does not.

What the code still needs

What stands between Swift code in a chat and an app on an iPhone
What is missingWhat it isWho can provide it
A projectThe files arranged as an app, with a name, an identifier, an icon and settingsXcode, Swift Playground, or an app builder
A buildThe code compiled into an app with Apple's iOS toolsXcode on a Mac, Swift Playground on an iPad or Mac, or a service with a Mac
A signatureProof of who made the app and which devices may run itYour Apple ID, through one of those tools
An installThe signed app copied to the phoneThe same tool, over a cable or through TestFlight

A project

ChatGPT usually gives you one or two files: a screen, perhaps a data model. An app is more than its screens. It needs a starting point that says which screen opens, a name and a bundle identifier, an icon, and a list of what it is allowed to use. When you create a project, Apple's documentation says Xcode makes one "containing essential configuration and source code files" for the kind of app you picked. The code from the chat goes inside that.

A build

Swift is text until it is compiled. For an iPhone that means Apple's own tools, which Apple ships in Xcode for the Mac and in Swift Playground for iPad and Mac. There is no Xcode for Windows, and the code in a chat window has not been through either tool. Compiling is also where you find out whether the code is right: a chat can produce code that reads well and still does not build.

A signature

An iPhone refuses any app it cannot trace to a signer. Apple's technote on provisioning profiles puts it flatly: Apple's platforms, the Mac aside, do not run arbitrary third-party code, and every app needs a profile that says who signed it, which app it is and where it may run. For your own phone, the signer is your Apple ID, and a free one is enough.

Route 1: a Mac with Xcode

If you have a Mac, or can borrow one for an afternoon, this route uses the code exactly as ChatGPT wrote it, and it needs no paid account.

  1. Install Xcode from the Mac App Store and open it.
  2. Create a project. On the Welcome to Xcode window choose App from the New Project menu, or choose File, New, Project. Give it a product name and an organization identifier; Xcode joins them into the bundle identifier.
  3. Paste the code in. In the Project navigator on the left, select the Swift file the template made and replace its contents with ChatGPT's. If the chat gave you several files, add a Swift file for each and keep the names it used.
  4. Run it in the Simulator. Pick a simulated iPhone in the run destination menu in the toolbar and click Run.
  5. Fix what does not build. Errors appear in Xcode's Issue navigator. Copy the full message and the lines around it back to ChatGPT, apply its answer and run again.
  6. Add your Apple ID under Xcode, Settings, Apple Accounts, and choose your team in the project's Signing & Capabilities pane.
  7. Connect your iPhone, choose it as the run destination and click Run.
  8. On the iPhone, turn on Developer Mode under Settings, Privacy & Security, and trust your Apple ID under Settings, General, VPN & Device Management.

Steps 6 to 8 have a guide of their own, with every setting named: how to run your Xcode app on your own iPhone with a free Apple ID.

What to expect: step 5 is where the time goes. Code written without a compiler tends to need a few rounds, and the typical trouble is small: a name that does not exist, a piece that was renamed in a newer iOS, a second file the chat forgot to give you. Xcode also has a coding assistant of its own that can explain or generate code.

Route 2: an iPad with Swift Playground

Apple's Swift Playground is an app for iPad and Mac that builds real SwiftUI apps. If you have an iPad and no Mac, it can compile ChatGPT's code:

  1. Install Swift Playground on the iPad and create a new app project.
  2. Paste the code into the project's Swift files, one file per piece of code the chat gave you.
  3. Run it. The app opens on the iPad itself.

That gets the app running on the iPad. Getting it onto your iPhone from there is a different matter. Apple's guide gives two ways out of Swift Playground: sharing the project file, and the Upload to App Store Connect button, which it says needs an Apple Developer account, and from App Store Connect the app reaches your iPhone through TestFlight. We go through that in how to get a Swift Playgrounds app onto your iPhone.

One more limit to know about: Swift Playground suits apps written purely in SwiftUI. If ChatGPT's answer leans on project settings or files that only Xcode has, it may not fit.

Route 3: no Mac and no iPad

On a Windows PC or a Chromebook, nothing on your desk can compile the code, so the build has to happen on a Mac somewhere else. There are two kinds of help.

A Mac you rent or a build service

You can rent a Mac in the cloud and use Xcode on it through a remote screen, which is Route 1 at a distance, or set up a build service that compiles your project on its machines. Both keep ChatGPT's code as it is. Both also expect you to manage a project, signing and uploads yourself, which is a lot to learn for one small app. Our guide on making iOS apps on Windows compares these.

An app builder that writes and builds

The other kind of help does the whole chain: an AI app builder that has its own Macs writes the code, puts it in a project, compiles it and gets it onto your phone. Borel is one of these, made to be the easiest way to build real native iPhone apps with AI, and it is worth being exact about what it does with your situation.

Where Borel fits, honestly

Borel works from a description, not from a folder of code. You describe the app in plain words, and Borel writes it in Swift with SwiftUI and compiles it with Xcode on its own Mac. When Xcode reports an error, Borel's AI fixes it and builds again, which is the loop you would otherwise run by hand between ChatGPT and Xcode.

So the useful thing to carry over from your chat is not the Swift. It is what you learned while getting it: the screens you want, what each one does, what should be saved. Give Borel that description and it builds the app from it.

  • See it run. The app opens in an iPhone simulator in your browser, streamed from Borel's Mac, on any computer. The free plan gives 5 free credits a day, up to 30 a month.
  • Put it on your iPhone. Borel Companion, an app for Windows and Mac, signs the app with your own Apple ID and installs it. A free Apple ID works. Installing with Companion comes with a paid plan, Pro, from $25 a month.
  • Keep the code. The app is ordinary SwiftUI. You can download the project, with a file that opens it in Xcode, and take it to a Mac later.
  • Publish it and grow it. With Pro, Borel builds, signs and uploads the app to the App Store from its own Mac, and the app can have sign-in, a cloud database and subscriptions. See publishing.

And where it does not fit: if what you want is to learn Swift by making ChatGPT's exact code compile, Borel skips the part you are after. Use a Mac and Route 1; you will learn more from ten compiler errors than from any guide.

A description to paste instead of code
Make an iPhone app that tracks my water intake. A big button adds a glass. The main screen shows today's count against a goal of 8 and a ring that fills up. A second tab shows the last 7 days as bars. Keep everything on the phone. Remind me at 10, 13 and 16 if I am behind.

The routes compared

Three ways to get an app from a chat onto an iPhone, as of 19 November 2026
Mac with XcodeiPad with Swift PlaygroundBorel
Uses ChatGPT's code as it isYesYes, if it is pure SwiftUINo: you describe the app
Who fixes build errorsYou, with ChatGPT's helpYou, with ChatGPT's helpBorel
What you needA MacAn iPadA browser on any computer
Getting it on your iPhoneRun from Xcode, with a free Apple IDTestFlight, with Apple's Developer ProgramCompanion, with a free Apple ID, on a paid plan
Apple's fee for your own phoneNone$99 a yearNone

After it is on your iPhone

Whichever route you take, an app signed with a free Apple ID lives under Apple's rules for free accounts. Its membership comparison lists them: an install opens for 7 days before it has to be signed again, a device holds up to 3 such apps, and an account can register 10 App IDs in a week. From Xcode, you press Run again each week. Companion signs the app again by itself while it runs on your computer.

Two things in ChatGPT's code can trip over those rules. If it added push notifications, iCloud or Sign in with Apple, expect signing with a free Apple ID to fail until those are removed, because Apple keeps them for its paid program. And if the code uses the camera, the microphone or your location, the project has to carry a sentence explaining why; iOS shows that sentence when the app asks for permission. Ask ChatGPT which of these its code uses before you start.

Common mistakes

  • Looking for a way to open a .swift file on the iPhone. There is none. The file has to be built into an app.
  • Asking ChatGPT to install the app. It can write and explain code. It has no access to your phone.
  • Pasting everything into one file when the chat meant several. Keep each file separate, with the name the chat gave it.
  • Paying Apple before you need to. Running your own app on your own iPhone does not need the paid program.
  • Giving up at the Untrusted Developer message. It is a one-time setting; see how to trust your own app.

The bottom line

ChatGPT gave you the code; an app also needs a project, a build and a signature. On a Mac, Xcode supplies all three and a free Apple ID is enough. On an iPad, Swift Playground builds the app and TestFlight carries it to your iPhone, with Apple's membership. With neither, a service has to do the building, and with Borel that means describing the app and letting it write and build its own Swift.

If you are still deciding whether to code at all, read can ChatGPT make an iPhone app for what the chat can and cannot do, or make your own iPhone app for the route with no code.

Questions people ask

Can I run Swift code from ChatGPT directly on my iPhone?

No. An iPhone runs apps, not source code. The Swift has to be placed in a project, compiled with Apple's tools and signed before the phone will open it.

Do I need a Mac to turn ChatGPT's Swift code into an app?

You need Apple's tools, which run on a Mac (Xcode) or on an iPad or Mac (Swift Playground). Without either, a service that builds on its own Mac has to do it.

Do I need to pay Apple to put the app on my own iPhone?

Not from Xcode: a free Apple ID can sign an app for your own devices, 7 days at a time. Apple's Developer Program, $99 a year, is needed for TestFlight and the App Store.

Why does the code from ChatGPT not build?

It was written without a compiler checking it. Typical causes are a missing second file, a name that does not exist, or code written for a different iOS version. Paste the exact error back and ask for a fix.

Can I paste my Swift code into Borel?

Not as code to build: Borel has no code import. It works from a description. You describe the app, and Borel writes the Swift, builds it on its own Mac and fixes build errors itself. Describe what your code does and let Borel write its own.

Can I use Swift Playground on an iPad to get the app on my iPhone?

Swift Playground builds and runs the app on the iPad. To reach an iPhone it uploads to App Store Connect, and the app then installs through TestFlight, which needs Apple's Developer Program.

Will the app keep working once it is on my phone?

With a free Apple ID each install opens for 7 days and then has to be signed again, by running it from Xcode or by a tool such as Borel Companion that renews it.

I think the code is rarely the problem; everything around it is.

– Sigsten

Build your own water tracker

Your idea is already written. Press the button, read it, change anything, and Borel builds it, free to start.

An app that tracks my water: a big button adds a glass, a ring shows today against a goal of 8, and a second tab shows the last 7 days as bars.
Build this app

Keep reading