0Pricing
React Native Academy · บทเรียน

การกำหนดค่าการลงนามด้วย EAS Build

ตั้งค่า eas.json ด้วยโปรไฟล์บิลด์สำหรับการใช้งานจริง รัน eas credentials เพื่อจัดการใบรับรอง และเรียกใช้ EAS Build เพื่อสร้างไฟล์ .ipa ที่ลงนามแล้ว

การกำหนดค่าการลงนามด้วย EAS Build เป็นบทเรียน React Native Academy ฟรีบน CoddyKit นี่คือบทเรียนที่ 2 จากทั้งหมด 4 บทเรียน คุณสามารถอ่านบทเรียนทั้งหมดด้านล่างฟรี — จากนั้นลองปฏิบัติด้วยตัวคุณเองในเบราว์เซอร์พร้อมตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7 บทเรียนนี้เป็นส่วนหนึ่งของเส้นทางการเรียน React Native Academy และความก้าวหน้าของคุณจะซิงค์ข้ามเว็บและแอป CoddyKit คอร์ส React Native Academy มีบทเรียนทั้งหมด 4 บทเรียน

บางส่วนของบทเรียนนี้ยังไม่ได้รับการแปล และแสดงเป็นภาษาอังกฤษ

What Is EAS Build

EAS Build (Expo Application Services Build) is a cloud build service that compiles your React Native or Expo app on Expo's infrastructure, producing a signed .ipa for iOS or .apk/.aab for Android. You do not need Xcode, Android Studio, or a Mac for iOS builds — EAS provides managed macOS machines. It also handles code signing credentials automatically.

Installing and Logging in to EAS CLI

EAS CLI is the command-line tool you use to trigger builds, manage credentials, and submit apps. Install it globally with npm, then log in with your Expo account. You need an Expo account (free) in addition to your Apple Developer account. Once logged in, EAS can communicate with Apple's API on your behalf to manage certificates and provisioning profiles.

# Install EAS CLI globally
npm install -g eas-cli

# Verify installation
eas --version

# Log in with your Expo account
eas login

# Check who you are logged in as
eas whoami

# Link your project (run from project root)
eas init

The eas.json Configuration File

All EAS Build behavior is configured in eas.json at the project root. You define build profiles — named configurations like development, preview, and production. Each profile specifies the distribution type, credentials source, environment variables, and platform-specific settings. Run eas build:configure to generate an initial eas.json automatically.

// eas.json
{
  'cli': { 'version': '>= 5.0.0' },
  'build': {
    'development': {
      'developmentClient': true,
      'distribution': 'internal',
      'ios': { 'simulator': true }
    },
    'preview': {
      'distribution': 'internal'
    },
    'production': {
      'distribution': 'store',
      'credentialsSource': 'remote'
    }
  },
  'submit': {
    'production': {
      'ios': { 'appleId': 'you@example.com' }
    }
  }
}

Setting Up Credentials Automatically

EAS can set up all iOS signing credentials automatically if you grant it access to your Apple Developer account. When you first run eas build --platform ios, EAS prompts you: generate a new certificate and provisioning profile, or use an existing one. Choose the auto-generate option and EAS creates a distribution certificate via the Apple API, generates a matching provisioning profile, and stores both securely in EAS's credential storage.

# Trigger a production iOS build
eas build --platform ios --profile production

# EAS prompts:
# ? Would you like to log in to your Apple account?
# > Yes
# Enter Apple ID: you@example.com
# Enter password: (app-specific password)
#
# ? Generate a new Apple Distribution Certificate?
# > Generate a new certificate  <- choose this
#
# ? Generate a new Provisioning Profile?
# > Generate a new profile  <- choose this
#
# Build queued...

Viewing and Managing Credentials

The eas credentials command opens an interactive menu to view, update, or remove stored credentials. You can see your certificate's expiry date, the provisioning profile type, and which App ID it covers. You can also fetch credentials from the cloud to use locally, or push a locally generated .p12 and .mobileprovision to EAS if you prefer to manage them yourself.

# View all stored credentials
eas credentials

# Select:
# Platform: iOS
# App: com.yourcompany.myapp
#
# EAS shows:
# Distribution Certificate
#   - Issued to: Your Name
#   - Expires: Dec 15, 2026
#   - Serial: A1B2C3...
# Provisioning Profile
#   - Type: App Store
#   - Expires: Dec 15, 2026
#   - Profile UUID: XXXXXXXXX

Environment Variables in EAS Build

EAS Build supports environment variables for build-time secrets and configuration. Define them in eas.json under the env key for a specific profile, or store sensitive values in EAS Secrets via eas secret:create. EAS Secrets are encrypted and only injected into builds — they are never logged or exposed to the public. Use them for API keys, tokens, or any value that must not be in source control.

// eas.json — environment variables per profile
{
  'build': {
    'production': {
      'distribution': 'store',
      'env': {
        'EXPO_PUBLIC_API_URL': 'https://api.yourapp.com',
        'APP_VARIANT': 'production'
      }
    },
    'preview': {
      'env': {
        'EXPO_PUBLIC_API_URL': 'https://staging.yourapp.com',
        'APP_VARIANT': 'staging'
      }
    }
  }
}

// Add secrets (sensitive values NOT in eas.json)
// eas secret:create --scope project --name STRIPE_SECRET_KEY --value sk_live_...

Triggering a Build and Monitoring Progress

Start a production iOS build with eas build --platform ios --profile production. EAS queues the build on a macOS runner and returns a build URL you can monitor in the browser. Build logs stream in real time. The build status progresses through: queued → in progress → finished. A finished build produces a download URL for the .ipa or an automatic TestFlight upload if configured.

# Build and submit to TestFlight in one command
eas build --platform ios --profile production --auto-submit

# Or build first, submit separately
eas build --platform ios --profile production

# View recent builds
eas build:list

# View build logs for a specific build
eas build:view <build-id>

Local EAS Builds for Debugging

If a cloud build fails and you cannot diagnose the issue from logs, run a local EAS build with eas build --local. This runs the exact same build process on your Mac using the same steps as the cloud runner. You get full access to intermediate files and can insert debugging steps. Local builds require Xcode installed but use EAS's build orchestration scripts.

# Run the EAS build locally on your Mac
eas build --platform ios --profile production --local

# The build output is placed in:
# ./build-*.ipa (in the project root)

# Useful flags:
# --no-wait     (don't stream output, just start)
# --clear-cache (ignore previous build cache)

Managed vs Bare Workflow Signing

In the managed workflow (Expo), EAS handles all native signing details — you just configure eas.json. In the bare workflow (ejected React Native), you can still use EAS Build but you manage the native project yourself. EAS still handles credential management and cloud compilation, but you may need to configure the Xcode project's signing settings manually via a config plugin or directly in ios/.

// eas.json — bare workflow needs explicit scheme
{
  'build': {
    'production': {
      'distribution': 'store',
      'ios': {
        'scheme': 'MyApp',  // Xcode scheme name
        'buildConfiguration': 'Release'
      }
    }
  }
}

Ad Hoc Distribution for QA Testers

Ad Hoc distribution lets you install a build directly on up to 100 specific registered devices without going through the App Store or TestFlight. Register tester device UDIDs in the Developer Portal, create an Ad Hoc provisioning profile, build with distribution: 'internal' in EAS, and share the install link. EAS can also register new device UDIDs for your team via the eas device:create command.

// eas.json — internal/ad-hoc build
{
  'build': {
    'qa': {
      'distribution': 'internal',
      'ios': { 'simulator': false }
    }
  }
}

# Register a tester's device
eas device:create

# Build for QA (generates ad-hoc signed .ipa)
eas build --platform ios --profile qa

# Share the install link from the EAS dashboard with testers

Troubleshooting Signing Errors

Common signing failures include: certificate mismatch (the stored cert doesn't match the provisioning profile — fix by regenerating both), expired certificate (renew via eas credentials), missing entitlements (a capability is in the entitlements file but not in the provisioning profile — add the capability in the Developer Portal and regenerate the profile), and wrong bundle ID (double-check ios.bundleIdentifier in app.json matches the App ID exactly).

# Common fix: clear and regenerate credentials
eas credentials --platform ios
# Select: Remove all credentials, then run build again

# Or manually force new certificate:
eas credentials --platform ios
# Select: Update Distribution Certificate

# Check bundle ID mismatch
cat app.json | grep bundleIdentifier
# Should match exactly what's in developer.apple.com > Identifiers

Quick Check

Test your understanding of React Native Mobile Development concepts from this lesson.

Lesson Recap

In this lesson you learned: how to configure eas.json with build profiles for development, preview, and production, how EAS manages iOS certificates and provisioning profiles automatically, and how to use environment variables and EAS Secrets for build-time configuration. You also saw how to trigger builds, run them locally for debugging, and troubleshoot common signing errors. Next up we prepare App Store metadata in App Store Connect.

คำถามที่พบบ่อย

บทเรียน “การกำหนดค่าการลงนามด้วย EAS Build” ฟรีหรือไม่

ใช่ — ข้อความเต็มของ “การกำหนดค่าการลงนามด้วย EAS Build” ฟรีให้อ่านที่นี่บนเว็บ เพื่อปฏิบัติแบบโต้ตอบ (ตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7) และปลดล็อคส่วนที่เหลือของคอร์ส React Native Academy ให้อัปเกรดเป็น CoddyKit PRO คอร์ส React Native Academy มีบทเรียนทั้งหมด 4 บทเรียน

คุณจะเรียนรู้อะไรในบทเรียน “การกำหนดค่าการลงนามด้วย EAS Build”

ตั้งค่า eas.json ด้วยโปรไฟล์บิลด์สำหรับการใช้งานจริง รัน eas credentials เพื่อจัดการใบรับรอง และเรียกใช้ EAS Build เพื่อสร้างไฟล์ .ipa ที่ลงนามแล้ว คุณปฏิบัติ React Native Academy ด้วยโค้ดที่ใช้งานได้จริงที่คุณเรียกใช้โดยตรงในเบราว์เซอร์ และติวเตอร์ AI ตลอด 24/7 ตอบคำถามของคุณขณะที่คุณไปผ่านบทเรียน

คุณต้องมีประสบการณ์ก่อนที่จะเริ่มเรียน React Native Academy หรือไม่

ไม่จำเป็นต้องมีประสบการณ์มาก่อน React Native Academy บน CoddyKit ออกแบบมาสำหรับผู้เริ่มต้นไปจนถึงผู้เรียนขั้นสูง คุณสามารถเริ่มต้นที่นี่หรือเริ่มจากตัวแรกและเรียนด้วยความเร็วของคุณเอง นี่คือบทเรียนที่ 2 จากทั้งหมด 4 บทเรียน

บทเรียน “การกำหนดค่าการลงนามด้วย EAS Build” ใช้เวลานานแค่ไหน

บทเรียน CoddyKit ส่วนใหญ่ใช้เวลาประมาณ 5–10 นาที แต่ละบทเรียนจึงสั้นและเป็นแบบโต้ตอบ คุณสามารถก้าวหน้าอย่างต่อเนื่องและกลับมาเรียนต่อจากตรงที่เพิ่งหยุดบนเว็บและแอปได้เลย

ฉันเขียนและรันโค้ดในบทเรียน React Native Academy นี้ได้ไหม

ได้ บทเรียน React Native Academy ทุกบทมีตัวแก้ไขโค้ดในตัว คุณจึงเขียนและรันโค้ดจริงได้เลยในเบราว์เซอร์ และได้รับข้อเสนอแนะจาก AI ในทันที — ไม่ต้องติดตั้งในเครื่องของคุณ

บทเรียนทั้งหมดในหลักสูตรนี้

  1. การตั้งค่าบัญชี Apple Developer และใบรับรอง
  2. การกำหนดค่าการลงนามด้วย EAS Build
  3. การเตรียมข้อมูลเมตา App Store ใน App Store Connect
  4. การส่งตรวจสอบและการตอบสนองต่อการปฏิเสธ
← กลับไปที่ React Native Academy