Create a Mac project in Apirex, describe a window-based workflow and connect your Mac to build a native SwiftUI app. You test the running app locally, refine it in chat and choose your own distribution route.
This walkthrough uses a personal research notebook with searchable notes and a Settings window. The example emphasizes windows, menu actions and keyboard behavior before distribution, not just the appearance of a single screen.
What makes a good Mac app
A useful Mac app makes windows, menus, pointer actions and keyboard commands work together. Specify these behaviors before polishing the interface so the result supports actual work.
| Item | Why | Notes |
|---|---|---|
| Eligible Apirex account | Create the correct platform project. | Check that your account is eligible to create the macOS project you need. |
| Mac with compatible Xcode | Build source on your computer. | Apple builds need a Mac. |
| Free disk space | Store dependencies, source and build output. | Check available storage when the helper reports insufficient space for desktop setup. |
| A terminal kept open | Maintain the helper connection. | Leave the desktop helper session running and use the same project command to resume it. |
| Real test device | Validate input and the main journey. | Run the desktop app on your Mac and test its actual windows, menus and keyboard flow. |
| Your own developer account for release | Distribute under your identity. | Store submission is separate from building and testing; you handle it yourself. |
Use a Mac with compatible Xcode and enough free storage for Apple tools, dependencies and project output. The helper checks storage and reports shortages before setup. Windows or Linux connection commands do not provide an Apple build environment.
Decide what each window represents. For this notebook, one working window can show the note list and editor, while Settings holds app-wide preferences. If you want multiple note windows, specify whether selection and drafts are independent. Closing a window should follow a deliberate policy, not accidentally discard work.
Menus make important actions discoverable to keyboard users. SwiftUI provides scene-based windows, the commands modifier for menu commands and a Settings scene for preferences. Shortcuts should invoke the same underlying action as the corresponding menu item or visible control.
Plan for resizing and focus. A note editor should keep usable text width and reachable controls in a narrow window, not only on a large display. A command that creates a note should not unexpectedly replace text in the currently focused field.
Choose a distribution direction early enough to shape access requirements. Local notes may need little beyond the app's own data; importing or exporting files introduces deliberate user choices and permission considerations. Ask for minimum necessary access and test cancellation or denial rather than requesting broad access to hide an error.
Prompting
Describe windows, menus, shortcuts and settings alongside the app's saved information. Tell the builder which editing policies it must clarify instead of choosing convenient defaults.
Create a native macOS research notebook in Swift and SwiftUI. Use a resizable main window with a note list, search field and detail editor. Each note has a title and body, with local persistence for the initial version. Add menu commands for creating a note and focusing search, with discoverable keyboard shortcuts that do not conflict with text editing. Provide a Settings scene for a compact-list preference. Keep important actions usable by pointer and keyboard. Ask me about autosave, deletion, multiple windows, export formats and shared accounts before deciding. Clearly label removable sample notes. Plan a focused build, then test creating, editing, searching and reopening a saved note.Select the Mac project type on apirex.com and send the brief in chat. It remains separate from an iPhone or iPad implementation; another platform's screens are not automatically reused. If companion apps later share records, deliberately connect them to the same backend and coordinate their access rules.
Use Chat to decide whether edits save automatically, whether blank notes are permitted and how deletion is confirmed. Use Build when those decisions are ready for implementation. Turn the approved policies into acceptance tests before spending time on secondary styling.
The following complete minimal SwiftUI app demonstrates where Settings and .commands belong. It uses an in-memory counter instead of real notes and is not a persistence implementation. Adapt its structure to the generated project rather than adding a second app entry point beside the existing one.
import SwiftUI
@main
struct NotebookDemoApp: App {
@State private var noteCount = 0
@AppStorage("compactList") private var compactList = false
var body: some Scene {
WindowGroup("Notebook") {
Text("Notes: \(noteCount)")
.frame(minWidth: 320, minHeight: 200)
}
.commands {
CommandMenu("Notes") {
Button("Add Note") { noteCount += 1 }
.keyboardShortcut("n", modifiers: [.command, .shift])
}
}
Settings {
Toggle("Compact list", isOn: $compactList)
.padding()
.frame(width: 260)
}
}
}Apple's SwiftUI app-essentials material explains scenes and commands. In the actual notebook, ask the builder to connect menu actions to the same model used by visible controls. A menu label appearing correctly does not prove that its action targets the intended window or survives relaunch.
Build and run
Connect your Mac, let the Apple tool checks finish and interact with the generated app running locally. Mac apps run on the Mac rather than inside an iPhone Simulator preview.
Connect the Mac app's project by copying its private command into Terminal on the development Mac. Use the actual project command, not the illustrative shell line below, so the helper works with the intended source folder. See Do I need a Mac for iOS development? for the Apple toolchain requirement shared by these projects.
Run the provided macOS shell command for this desktop project. Helper installation on Windows or Linux serves other supported workflows, not local macOS compilation, and Windows users receive shell-specific instructions rather than translating commands. Do I need a Mac for iOS development? covers the same Xcode dependency behind Apple builds.
curl -fsSL https://apirex.com/install.sh | sh -s -- connect <your-private-token>Protect the desktop project's private connection details and remove them from any screenshot before asking for help. Never connect using another person's token. Keep its terminal session alive during builds; if it closes, resume by launching the project's connection command again. The local-builder guide explains what remains on your computer.
Apirex Local Agent performs the connected desktop work in a standard source directory, including dependency setup and checked builds. The installer provides a private Node.js copy if its check cannot find version 18 or above; no advance Node, npm or global-package setup is required. AI app builder that runs locally describes the same local helper in more detail.
Apple setup includes checks for Xcode and the iOS Simulator runtime; those checks are not evidence that a desktop app uses an iPhone preview. Get Xcode from Apple, allow for its download, and personally approve local licence or password requests. Read Do I need a Mac for iOS development? for toolchain preparation rather than assuming a connected helper is ready to compile.
For this project, the final runtime is the Mac app itself, even though Apple setup checks include Simulator resources. Open the ordinary source folder in Xcode to inspect it when needed. Back up source using your own Git workflow before broad manual edits, and avoid moving the folder during active work.
- Use Build to implement the agreed notebook scope, wait for the result and interact with the running Mac app.
- Create a note with a long title and several paragraphs. Switch notes and reopen the original to check the chosen autosave or explicit-save policy.
- Resize through narrow and wide working sizes. Confirm the search field, list, editor and important actions remain usable.
- Invoke menu actions by pointer and by shortcut while the editor has focus. If multiple windows are supported, confirm which window receives each action.
- Open Settings and change the compact-list preference. Check the intended effect, then quit and reopen to verify the requested persistence of both preference and notes.
Refine through a reproducible chat report. For example: With the editor focused, the search shortcut does nothing; move focus to search without altering the note text and preserve the selected note. After the repair, test the menu action and shortcut together so they remain consistent.
Test cancellation and invalid input for file features. Cancelling export should not create an unexpected file, while cancelling import should not erase the selection. Request those features explicitly if needed; a note editor does not imply a complete file workflow without further requirements.
Review recorded history and revert to an earlier point if a correction introduces a regression. A clean build does not prove correct focus, window targeting or persistence. Keep a short record of actual entered values and observed results for the release candidate.
If computer work stops, inspect the terminal and pending local approvals first. Reconnect with the same project's private command when the terminal was closed. Do not expose its token or personal note content in a public troubleshooting screenshot.
Distribute
Choose a Mac App Store release or distribution outside the store, then sign and package for that route. You manage the Apple account and submission; Apirex does not sign in or publish the native app for you.
For the Mac App Store, open the generated project in Xcode and select your own Apple Developer team in Signing & Capabilities. Review the bundle identifier, capabilities, release version, build number and icons. Archive, validate and upload to App Store Connect, then handle beta testing, listing details and review submission yourself.
As of November 2026, Apple's account guidance distinguishes free personal testing from paid Apple Developer Program distribution. TestFlight and App Store distribution require membership. For iPhone and iPad personal-device testing, a free account can use Xcode's Personal Team within its limitations; this Mac project's local run is distinct from those Simulator and device workflows.
App Sandbox limits access to system resources and user data through entitlements. Apple requires it for Mac App Store distribution. For outside-store distribution, sandboxing and notarization are separate mechanisms: notarization does not replace sensible access restrictions, while disabling the sandbox is not a general solution to file-access errors.
For the standard outside-store path, use your Developer ID signing identity, enable Hardened Runtime and submit the packaged software for notarization using Apple's current workflow. Apple's Developer ID guidance explains the signing and Gatekeeper relationship. Request only the entitlements your actual features need rather than broad exceptions to make a development build run.
Notarization is an automated security and signing check, not App Review or a guarantee that the app works correctly. Follow Apple's instructions to staple the resulting ticket where appropriate, and test the delivered package on another Mac. Verify first launch, saved notes and keyboard commands outside the development environment.
Review permissions against real behavior before either release. If the notebook imports a user-selected file, test that exact interaction, including cancellation and denied access. A successful run from your development setup may not represent what another person's installation can access.
Keep signing material and account credentials out of prompts and source. Use actual screenshots and describe only behavior verified in the distributed configuration. Preserve the source and release settings associated with each delivered build so future fixes do not start from an uncertain prototype.
Frequently asked questions
Do I need a Mac and Xcode?
Yes. The native Mac project is built using Xcode on your Mac and runs locally.
Is the preview in iOS Simulator?
No. Mac apps run on the Mac; the Simulator workflow is for iPhone and iPad projects.
Does the snippet save notes?
No. It demonstrates scenes, a command and a settings preference; the note counter remains in memory.
Is notarization App Review?
No. Apple describes notarization as an automated check for malicious content and signing problems, separate from App Review.
Is App Sandbox required outside the store?
Apple requires it for the Mac App Store. Evaluate sandbox permissions separately from Developer ID signing, Hardened Runtime and notarization for outside-store distribution.
All guides
Native foundations
Build with AI
- How to build an Android app with AI
- How to build an iOS app with AI
- How to build an iPad app with AI
- How to build a Mac app with AI
- How to build an app without coding
- Prompts that produce good apps
- Local AI app builder: build apps on your own computer
- How to add payments to your app
- Gradle build failed: common fixes
Google Play
Apple distribution
Build it on your own computer
Describe the app and Apirex writes real source you own, then builds it on your machine.
Opens Apirex with this prompt. Pick the Android · Kotlin tab before you send. The Free plan includes 5 Rex Credits a day.