Build with AI

How to build an iOS app with AI

Build a SwiftUI iPhone app on your Mac, refine the running Simulator preview and prepare your own release.

Apirex TeamUpdated
On this page
  1. What you need (Mac + Xcode)
  2. Write the prompt
  3. Preview in the iOS Simulator
  4. Refine
  5. Prepare for the App Store
  6. Frequently asked questions

Create an iOS project in Apirex, describe a focused iPhone workflow and connect your Mac to build a SwiftUI app. You can inspect the running iOS Simulator inside the builder, refine it and prepare your own App Store release.

This walkthrough uses a personal reading log with a library, book details and reading sessions. The sample prompt is a request to implement those features, not a promise that every generated project already includes them.

What you need (Mac + Xcode)

You need a Mac with compatible Xcode and an Apirex account eligible for iOS projects. The iOS Simulator preview does not require paid Apple membership.

What you need
ItemWhyNotes
Eligible Apirex accountCreate the correct platform project.Confirm iPhone project eligibility in your account before planning this build.
Mac with compatible XcodeBuild source on your computer.Apple builds need a Mac.
Free disk spaceStore dependencies, source and build output.Resolve any disk warning before downloading the iPhone development tools.
A terminal kept openMaintain the helper connection.Keep Terminal active through iPhone builds; rerun your command after a disconnection.
Real test deviceValidate input and the main journey.Inspect the iPhone Simulator, then check device-specific behavior on the phone itself.
Your own developer account for releaseDistribute under your identity.Store submission is separate from building and testing; you handle it yourself.

Check that your Mac can run the Xcode installation you intend to use. Allow room for Apple tools, Simulator resources, dependencies and project output rather than assuming one universal storage allowance. The helper reports free-space shortages before setup; respond to that actual message.

As of November 2026, Apple allows personal-device testing with a free Apple Account through Xcode's Personal Team, with limitations and periodic reprovisioning. Paid Apple Developer Program membership is needed for TestFlight and App Store distribution. Keep these stages distinct: evaluating the Simulator app does not require organizing store distribution first.

Prepare an acceptance checklist before you build. For this example, add a book, record a session, edit an incorrect value and reopen the record. That makes previewing an exercise in checking behavior, not simply approving the first attractive screen.

Write the prompt

Name the audience, navigation, saved information and error states in the opening prompt. Ask the builder to clarify uncertain rules rather than inventing policies about your records.

Text
Create a native iPhone reading-log app in Swift and SwiftUI for personal reading. Include a library screen, book details, an add-book form and a reading-session form. Each book has a title, optional author and reading status. Each session records a date, minutes and an optional note. Start with local storage and clearly labeled sample content that can be removed. Use readable typography, accessible control labels and helpful empty states. Reject empty titles and explain invalid session values beside the fields. Ask me about allowed session ranges, editing rules, export and accounts instead of guessing. Plan a focused version, then test adding a book, saving a session and reopening details.

Choose the iOS project type. An iPad or Mac project is separate, and creating another platform does not automatically copy this app's screens or source. If companion projects later share records, deliberately connect them to the same backend and specify matching data rules.

Use Chat to decide whether a zero-minute session is invalid or a useful note, and whether deleting a book also removes sessions. Use Build for implementation and computer work after agreeing on those rules. Discussion of a feature is not evidence that the feature has been implemented.

Keep the first version local unless shared accounts are essential. If you need a backend, connect your own Supabase project deliberately and ask for access rules as well as screens. Private service keys belong in backend secrets, never in the app's source.

Preview in the iOS Simulator

Connect your Mac and let Apirex build, install and launch the app in Apple's iOS Simulator. The builder shows that running Simulator, not a static mockup of an iPhone screen.

On your Mac, take the private command from this iPhone project's screen and run it in Terminal. This links the computer that will store and build the SwiftUI source. Treat the generic example below as an illustration only. For the underlying hardware requirement, read Do I need a Mac for iOS development?

Use the macOS command provided for the iPhone project. The helper also supports Linux and Windows shells, but those connection options cannot replace a Mac for Xcode builds. The Mac requirement guide explains that distinction; copying a Windows command onto another machine will not supply Apple's tools.

bash
curl -fsSL https://apirex.com/install.sh | sh -s -- connect <your-private-token>

Keep your iPhone project's token secret, including in screenshots or support requests, and reject commands belonging to someone else's project. Leave Terminal running while the helper builds or previews. If you close it, computer work loses its connection; rerun this project's command to reconnect. AI app builder that runs locally explains the helper's role.

The connection starts Apirex Local Agent and checks its Node.js requirement, version 18 or later. If necessary the installer downloads its own copy, without requiring a separate Node, npm or global-package installation. Your iPhone files and build results stay in a regular local folder. The local-builder guide explains how this helper supports computer work.

For Apple setup, the helper checks Xcode and the iOS Simulator runtime. Obtain Xcode from Apple and allow for a large download; any Apple licence prompts and macOS password approvals must be approved locally by you. A connected computer does not mean every development tool is ready yet.

  1. Wait for the connection, Xcode checks and Simulator resources to be ready. Resolve local approvals before treating setup delays as code errors.
  2. Use Build to implement the agreed reading-log scope. Answer questions about your policies before the builder commits to an unsupported assumption.
  3. When the app launches, add a book, open it, record a session and return to the library. Note the exact step where behavior differs from your checklist.
  4. Repeat with empty input and a long book title. Check the form with the keyboard visible and confirm the save action is reachable.

If the preview is missing, distinguish a disconnected computer from unfinished Apple setup. Inspect the helper terminal and local Simulator before asking for an interface rewrite. When a terminal was closed, run the same project's command again and keep the source folder intact.

During Xcode testing, use more than one intended iPhone size, especially for forms with several fields. Record the configuration alongside a bug report. A layout fitting one preview does not establish that labels, text fields and actions remain usable everywhere you intend to support.

Refine

Refine with chat or select a visible element in the iPhone Simulator preview and describe the change. Use selection for a specific visible element and chat for underlying behavior or data rules.

For example, select the session total and request a larger value while keeping its descriptive label beneath it. State what should not change, such as the form order and validation. Then verify both the appearance and the original reading journey after the edit.

For behavior, provide reproduction steps: save a session, edit its minutes, then return to book details; the total still shows the earlier value. Ask for the saved record and displayed total to update without creating a duplicate session. That is more useful than saying that the app feels inconsistent.

Test deletion, cancellation and invalid values separately from successful creation. Cancel a partially completed form and check your agreed draft policy. Reopen saved books after restarting the app. A successful compile cannot prove that persistence, totals or deletion follows the rules you approved.

Review recorded history before broad redesigns and revert to an earlier point if a correction causes a regression. The generated Swift source is in a normal folder you can open in Xcode and back up using Git. History helps review changes but does not replace your source backup.

Before release, run on your own iPhone in Xcode with your own signing team. Free personal testing has Apple's limitations, while store distribution uses your paid program membership. Check text input, keyboard dismissal, real saved data and any permissions your actual feature set requires.

Keep a compact test record: entered values, expected result, actual result and device configuration. Repeat the repaired case and the ordinary journey after every meaningful change. Avoid sending private reading notes or account details in screenshots when harmless test entries can reproduce the same issue.

Prepare for the App Store

Archive the app in Xcode with your own Apple Developer team and upload through Apple's distribution workflow. Manage TestFlight, the listing and submission in your own App Store Connect account.

Open the generated iPhone project in Xcode and select the app target. In Signing & Capabilities, choose your own Apple Developer team, confirm the intended bundle identifier and review capabilities. Keep signing credentials out of chat and source files; sign in locally under your control.

Review the release version, build number, icons and configuration. Remove disposable sample records, confirm any release backend, and create the corresponding app record in App Store Connect. Archive in Xcode with an appropriate distribution destination, validate and upload using Apple's distribution workflow.

Use TestFlight to collect beta feedback, then correct problems and repeat the original acceptance journey in the final candidate. Complete the listing, screenshots and required declarations in App Store Connect, and submit for review yourself. Apirex does not sign into Apple services or submit native apps.

As of November 2026, Apple's account and distribution guidance distinguishes free personal testing from paid Apple Developer Program membership for TestFlight and App Store distribution. Simulator preview needs no paid membership. For personal-device testing, a free Apple Account can use Xcode's Personal Team, subject to limitations and periodic reprovisioning; consult Apple's current account guidance before relying on it.

Use screenshots from the actual app and describe only implemented behavior. Make sure privacy information reflects the release configuration rather than an earlier prototype. Archive the source and settings used for the candidate so a later correction starts from a known state. Neither successful compilation nor submission guarantees approval.

Frequently asked questions

Can I build iOS apps on Windows?

The Apple workflow requires a Mac with compatible Xcode. Windows connection commands do not provide an Apple build environment.

Do I need a paid Apple account to preview?

No. Watching your iPhone app run in the Simulator on your Mac is free. You only need the paid Apple Developer Program when you want testers on TestFlight or a release on the App Store.

Can I test on my iPhone for free?

Apple permits personal testing through a free Apple Account and Xcode Personal Team, subject to limitations and periodic reprovisioning.

Can I select an element in the preview?

Yes. Select a visible element in the iPhone Simulator preview and describe the change; use chat for data and behavior changes.

Does Apirex submit the app?

No. You sign and archive with your own team and handle upload, TestFlight and review through your Apple account.

All guides

Build it on your own computer

Describe the app and Apirex writes real source you own, then builds it on your machine.

AndroidKotlin · Jetpack ComposeReal source on your computer

Opens Apirex with this prompt. Pick the Android · Kotlin tab before you send. The Free plan includes 5 Rex Credits a day.