You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

请求ExpoKit应用iOS及Android分发打包分步指南

Hey there! I totally get where you're coming from—ExpoKit has some subtle but important differences from standard Expo apps when it comes to packaging, and it's easy to feel stuck when the docs don't spell it out clearly. Let's walk through the step-by-step process for both iOS and Android to get your app ready for distribution.

iOS 打包分步指南

Since you already have a running ExpoKit app, you should have an ios directory in your project root. Here's what to do next:

  1. Prep your environment & dependencies

    • First, make sure you're on the latest Expo CLI: npm install -g expo-cli or yarn global add expo-cli
    • Navigate to your project root and run expo install to sync all dependencies with your ExpoKit version—this avoids weird compatibility bugs later.
  2. Configure signing credentials in Xcode

    • Open your project in Xcode using the ios/[YourProjectName].xcworkspace file (not the .xcodeproj—this is crucial for CocoaPods dependencies).
    • Go to the Signing & Capabilities tab for your main target.
    • Log in with your Apple Developer account if you haven't already, then select your team. Xcode will automatically create or fetch the necessary distribution certificate and provisioning profile (make sure you pick the right type: App Store, Ad Hoc, or Enterprise depending on your distribution needs).
  3. Build the archive

    • In the Xcode toolbar, set the target device to Any iOS Device (arm64).
    • Go to Product > Archive in the top menu.
    • Wait for Xcode to finish building—this might take a few minutes depending on your project size. Once done, the Organizer window will pop up with your new archive.
  4. Export the IPA for distribution

    • In the Organizer, select your archive and click Distribute App.
    • Choose your distribution method:
      • App Store Connect: For submitting to the App Store
      • Ad Hoc: For testing with a limited group of users
      • Enterprise: For internal company distribution
    • Follow the on-screen wizard to confirm settings, select export options, and save the IPA file to your local machine.
Android 打包分步指南

ExpoKit Android projects use Gradle, so the process is similar to standard native Android apps but with a few Expo-specific checks.

  1. Prep your environment

    • Ensure Android Studio is installed and the ANDROID_HOME environment variable is set correctly on your system.
    • Update Expo CLI: npm install -g expo-cli
    • Run expo install in your project root to sync dependencies.
  2. Generate a signing keystore (if you don't have one)

    • Open a terminal and run this command to create a keystore file (replace placeholders with your own details):
      keytool -genkey -v -keystore my-release-key.keystore -alias my-key-alias -keyalg RSA -keysize 2048 -validity 10000
      
    • Move the generated my-release-key.keystore file to the android/app directory of your project.
  3. Configure Gradle for signing

    • Open android/gradle.properties and add these lines (fill in your keystore details):
      MYAPP_RELEASE_STORE_FILE=my-release-key.keystore
      MYAPP_RELEASE_KEY_ALIAS=my-key-alias
      MYAPP_RELEASE_STORE_PASSWORD=your_keystore_password
      MYAPP_RELEASE_KEY_PASSWORD=your_key_alias_password
      
    • Open android/app/build.gradle and update the buildTypes block to include signing configs:
      android {
        // ... other configurations
        signingConfigs {
            release {
                if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
                    storeFile file(MYAPP_RELEASE_STORE_FILE)
                    storePassword MYAPP_RELEASE_STORE_PASSWORD
                    keyAlias MYAPP_RELEASE_KEY_ALIAS
                    keyPassword MYAPP_RELEASE_KEY_PASSWORD
                }
            }
        }
        buildTypes {
            release {
                // ... existing release configs
                signingConfig signingConfigs.release
            }
        }
      }
      
  4. Build the APK or AAB

    • For APK (direct distribution): Run this command from your project root:
      cd android && ./gradlew assembleRelease
      
      The APK will be at android/app/build/outputs/apk/release/app-release.apk
    • For AAB (recommended for Google Play): Run:
      cd android && ./gradlew bundleRelease
      
      The AAB will be at android/app/build/outputs/bundle/release/app-release.aab
Quick Tips to Avoid Headaches
  • Always run expo update before packaging to make sure ExpoKit and your Expo SDK version are in sync—mismatches cause most build errors.
  • For iOS, double-check that any third-party native modules you're using are properly linked in Xcode (ExpoKit handles most, but some might need manual setup).
  • For Android, if you hit dependency conflicts, run ./gradlew dependencies from the android directory to inspect the dependency tree and adjust versions as needed.

内容的提问来源于stack exchange,提问作者Sebastian Garrido

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 07:31:22