当前位置: 首页 > news >正文

Flutter自动打包ios ipa并且上传

该脚本会自动打包ios ipa 并自动上传至苹果后台,中间自动flutter clean ,自动 pod install
里面需要填写自己应用的 apiKey和apiIssuer
如我的例子中apiKey 为 1234 apiIssuer 为5678,
首先flutter 工程目录 新建 shell目录,目录下新建ipa.sh文件,拷贝如下代码

#!/bin/bash
#### @author: wds# @description: # @LastEditTime: 2024-09-04 17:42:02
### echo "iOS 打包AppStore渠道包"# Stop on errors
cd ..
set -e # Save current directory
current_dir=$(pwd)# Clean the Flutter project
echo "Cleaning Flutter project..."
flutter clean# Get all the dependencies
echo "Getting dependencies..."
flutter pub get# Navigate to the iOS directory
echo "Navigating to the iOS directory..."if [ -d "ios" ]; thencd ios# Install CocoaPods dependenciesecho "Installing CocoaPods dependencies..."pod install# Go back to the original directorycd "$current_dir"echo "CocoaPods setup completed successfully."# Build the iOS appecho "Building the iOS app..."flutter build ipa --release --target=lib/main.dartecho "iOS app build completed successfully."# 上传echo "Upload ipa..."xcrun altool --upload-app --type ios -f build/ios/ipa/*.ipa --apiKey 1234 --apiIssuer 5678echo "Upload ipa successfully."elseecho "Error: 'ios' directory does not exist."exit 1
fi# Optional: Open the iOS project in Xcode (uncomment if needed)
# echo "Opening iOS project in Xcode..."
# open ios/Runner.xcworkspaceecho "All tasks completed successfully."

运行

cd shell
执行 ./ipa.sh

http://www.mrgr.cn/news/22615.html

相关文章:

  • JavaEE 第23节 TCP的流量控制与阻塞控制详解
  • 数据库系列之GaussDB数据库中逻辑对象关系简析
  • ​zookeeper集群配置与启动
  • ASP.NET MVC 迅速集成 SignalR
  • ssm校园二手交易平台小程序 LW PPT源码调试讲解
  • 快速入门游戏领域,开发游戏需要哪些技术?
  • Java基本语法---运算符
  • 内网离线版 麒麟系统、统信欧拉版(UnionTech OS Server 20)如何将内存CPU跑到百分八十
  • librdkafka Windows编译
  • 技术分享-商城篇-优惠券管理-功能介绍及种类(二十四)
  • 基于SSM的流浪动物管理系统的设计与实现82901
  • Python OpenCV精讲系列 - 入门指南(一)
  • 微信公众号获取 openid: 从零到一快速实现一个微信公众号授权项目
  • (11)(2.1.1) PWM、OneShot和OneShot125 ESC(一)
  • Spring入门案例创建流程
  • 0基础跟德姆(dom)一起学AI Python进阶09-算法和数据结构
  • 单例模式详解:实现方法、优缺点及应用场景
  • Vue的slot插槽(默认插槽、具名插槽、作用域插槽)
  • 提升工作效率的秘密武器:选择合适的编程工具
  • STM32 之 SDRAM 详解