Beginner45 minutesUpdated October 2025

How to Build an iOS App with Next.js in 2025

Transform your Next.js web app into a native iOS application using Capacitor. This comprehensive guide covers everything from initial setup to publishing on the App Store.

📋 Prerequisites

  • Next.js project ready
  • macOS computer (required for iOS development)
  • Xcode installed from Mac App Store
  • Apple Developer account ($99/year)

🎯 What You'll Learn

  • Configure Next.js for iOS development
  • Set up Capacitor for iOS
  • Build and run your app in iOS Simulator
  • Add iOS-specific features
  • Prepare for App Store submission

Step-by-Step Guide

1

Install Xcode and Command Line Tools

Download Xcode from the Mac App Store (it's large, ~10GB). After installation, install the command line tools.

# Install command line tools
xcode-select --install

# Verify installation
xcode-select -p

💡 Note: Xcode is required for iOS development and can only run on macOS.

2

Configure Next.js for Static Export

iOS apps need static files. Configure Next.js to export a static site.

next.config.ts
const nextConfig = {
  output: 'export',
  images: {
    unoptimized: true,
  },
  trailingSlash: true,
};

export default nextConfig;
3

Install and Initialize Capacitor

Add Capacitor to your Next.js project and configure it for iOS.

npm install @capacitor/core @capacitor/cli @capacitor/ios
npx cap init

💡 Note: When prompted, enter your app name and bundle ID (e.g., com.yourcompany.appname).

4

Update Capacitor Config

Configure Capacitor to use the correct build directory.

capacitor.config.ts
import { CapacitorConfig } from '@capacitor/cli';

const config: CapacitorConfig = {
  appId: 'com.yourcompany.appname',
  appName: 'Your App Name',
  webDir: 'out',
  ios: {
    contentInset: 'automatic',
  }
};

export default config;
5

Add iOS Platform

Add the iOS platform to your project. This creates an ios folder with an Xcode project.

npx cap add ios
6

Build Your Next.js App

Build your Next.js app and sync it with the iOS project.

npm run build
npx cap sync ios

💡 Note: Run 'npx cap sync ios' every time you update your web code.

7

Open in Xcode

Open your iOS project in Xcode to configure signing and build settings.

npx cap open ios
8

Configure Signing in Xcode

Set up code signing so you can run your app on devices and submit to the App Store.

1. Select your project in the left sidebar
2. Select the "App" target
3. Go to "Signing & Capabilities" tab
4. Check "Automatically manage signing"
5. Select your development team
6. Xcode will create a provisioning profile

💡 Note: You need an Apple Developer account to sign apps.

9

Run on iOS Simulator

Test your app on the iOS Simulator before deploying to a real device.

1. In Xcode, select a simulator (e.g., iPhone 15 Pro)
2. Click the "Play" button or press Cmd+R
3. Wait for the simulator to boot and your app to launch

💡 Note: First launch can take a few minutes. Subsequent launches are faster.

10

Test on a Real Device

Connect your iPhone or iPad via USB to test on a real device.

1. Connect your iPhone via USB
2. Trust the computer on your device
3. Select your device in Xcode (top bar)
4. Click "Play" to build and run
5. Trust the developer certificate on your device

💡 Note: Go to Settings → General → VPN & Device Management to trust the certificate.

🚀 Next Steps

  • Add app icon and splash screen
  • Configure display name and version
  • Add privacy descriptions for permissions
  • Test on multiple iOS versions
  • Prepare for App Store submission

Ready to Build Your Mobile App?

Get NextNative and start converting your Next.js website to a mobile app in minutes.

🎁50% off for the first 40 customers, 5 left

Related Tutorials

Compare Mobile Frameworks

Still deciding on your tech stack? Check out these comparisons

📚 Further Reading

Explore our comprehensive documentation to learn more about NextNative features and capabilities.