How to generate an iOS IPA file with Ionic Framework?

前端 未结 4 857
我寻月下人不归
我寻月下人不归 2020-12-04 14:28

I\'ve successfully built the iOS app with the ionic build ios command. But now I want to use TestFlight and it asks me for an IPA file. It seems that file is no

相关标签:
4条回答
  • 2020-12-04 15:08

    this article is kind of old but should help you.

    In Command line change into the folder that contains your *.xcodeproj, and run the following:

    xcodebuild -target "My Target" -scheme "My Scheme"
    -configuration Release clean archive
    

    Now you’ve got your xcarchive , Following line will generate ipa which you can upload to TestFlight.

    cd platforms/ios/build/device/usr/bin/xcrun -sdk iphoneos PackageApplication "$(pwd)/$PROJECT_NAME.app" -o "$(pwd)/$PROJECT_NAME.ipa"
    

    Hope this helps

    0 讨论(0)
  • 2020-12-04 15:09

    What I do is to run this command:

    ionic cordova run ios
    

    It will build and make the project, generate the IPA and then launch the simulator. At that moment I just quit the simulator and voila! I have my IPA with just one command (Ionic 4).

    0 讨论(0)
  • 2020-12-04 15:15

    You can easily build IPA from ionic framework. by following these steps

    1. Navigate to app folder

    1. Run cordova build command

    1. Open the Xcode Project

    1. Clean the project

    1. Select iOS mobile device to build for, don't use iOS emulator as device otherwise the archive is disabled.

    1. Archive the project

    1. Distribute the project

    1. Choose a method for distribution

    1. Choose a Profile

    1. Select a location to save the .ipa file

    I have generate my .ipa file by using these steps hope it will works for your's.

    0 讨论(0)
  • 2020-12-04 15:25

    Use npx ionic build ios --device to build the IPA for debugging and adhoc installations

    Use npx ionic build ios --device --release to build for release.

    You need to have a build.json file to specify your keys. Note the CLANG is to prevent compilation errors from the CocoaPods which they made into an error rather than a warning from before.

    {
      "ios": {
        "debug": {
          "buildFlag": [
            "CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES"
          ],
          "developmentTeam": "XXXXXX",
          "automaticProvisioning": true,
          "packageType": "development"
        },
        "release": {
          "buildFlag": [
            "CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES"
          ],
          "codeSignIdentity": "Apple Development",
          "developmentTeam": "XXXXXX",
          "automaticProvisioning": true,
          "packageType": "app-store"
        }
      }
    }
    

    Before it will upload to AppStore/TestFlight you need to modify the platform/ios/exportOptions.plist file to include

    <key>destination</key>
    <string>upload</string>
    

    Then deploy it to the AppStore as follows

    xcodebuild -exportArchive -archivePath "platforms/ios/myApp.xcarchive" \
      -allowProvisioningUpdates \
      -exportOptionsPlist platforms/ios/exportOptions.plist \
      -exportPath platforms/ios/build/device
    
    
    0 讨论(0)
提交回复
热议问题