Skip to content
Snippets Groups Projects
build-ios.sh 963 B
Newer Older
  • Learn to ignore specific revisions
  • Markin Igor's avatar
    Markin Igor committed
    #!/usr/bin/env bash
    
    flavor='production'
    scheme='production'
    configuration='Release-production'
    entryPoint='main.dart'
    bundleName="Vereign"
    
    if [[ $1 == 'development' ]]
    then
        flavor='development'
        scheme='development'
        configuration='Release-development'
        entryPoint='main-dev.dart'
        bundleName="Vereign-dev"
    fi
    
    # Build ios
    
    Markin Igor's avatar
    Markin Igor committed
    flutter build ios --flavor ${flavor} -t lib/${entryPoint}
    
    Markin Igor's avatar
    Markin Igor committed
    
    # Export xarchive
    xcodebuild \
        -workspace ios/Runner.xcworkspace \
        -scheme ${scheme} \
        -sdk iphoneos \
        -configuration ${configuration} \
        archive -archivePath \
        build/ios/${bundleName}.xcarchive
    
    # Package ipa
    xcodebuild \
        -exportArchive \
        -archivePath build/ios/${bundleName}.xcarchive \
        -exportOptionsPlist ios/Runner/Info.plist \
        -exportPath build/ios/${bundleName}
    
    # Move packages wherever we need
    # cp build/ios/Vereign/production.ipa /path && cp build/ios/Vereign-dev/development.ipa /path
    
    # Cleanup
    # flutter clean