Code Monkey home page Code Monkey logo

ywautopackage's Introduction

YWAutoPackage - iOS项目自动打包脚本

⚠️注意:

项目第一次必须手动打包成功才能正常使用该脚本,Xcode 手动打包后才会把打包所需文件备齐

1、将YWAutoPackage文件夹直接拖到桌面

2、配置打开编辑YWAutoPackage.sh中的配置相关参数

3、再将YWAutoPackage.sh脚本文件拖入终端回车即可执行自动打包脚本

4、执行脚本后按需求输入选择打包版本

Dev 开发版、Hoc 测试版、App Store 生产版、Enterprise 企业版

5、如果执行脚本时出现如下错误是因为文件权限不足,只需对其授权777即可

-bash: /Users/candy/Desktop/YWAutoPackage/YWAutoPackage.sh: Permission denied

执行如下授权命令即可(这里的参考了上面的路径地址)

chmod -R 777 /Users/candy/Desktop/YWAutoPackage/YWAutoPackage.sh

6、如果需要上传 App Store,则安装 Transporter 上传工具,并且配置开发者账号和专用密码

打包脚本核心内容展示

# 先组装路径 archive_path、ipa_path ,用于导出 ipa 和 上传
archive_path="${temp_path}/${ipa_dir}/${pro_name}.xcarchive"
ipa_path="${temp_path}/${ipa_dir}/${pro_name}.ipa"

# Clean操作
xcodebuild clean -${pro_clean} ${pro_full_name} -scheme ${pro_name} -configuration ${pro_environ}
judgementLastIsSuccsess $? "Clean"

# Archive操作
xcodebuild archive -${pro_clean} ${pro_full_name} -scheme ${pro_name} -archivePath ${archive_path}
judgementLastIsSuccsess $? "Archive"

# 导出IPA文件操作
xcodebuild -exportArchive -archivePath ${archive_path} -exportOptionsPlist ${plist_path} -exportPath ${temp_path}/${ipa_dir}
judgementLastIsSuccsess $? "导出IPA文件"

# 删除 xcarchive 包
rm -r ${archive_path}


# ============ 上传到App Store ============  
# 获取 Transporter 上传工具【推荐】
toolPath="/Applications/Transporter.app/Contents/itms/bin/iTMSTransporter"
${toolPath} -m upload -assetFile ${ipa_path} -u ${apple_id} -p ${apple_pwd} -v informational
# ============ 上传到App Store ============ 
 

如果不上传蒲公英或不上传App Store的话 注释下面两句话即可(如果没填写相关账号则不会执行上传操作)

# 上传蒲公英分发平台
uploadPGY

# 上传 App Store
uploadAppStore
图片名称

ywautopackage's People

Contributors

aawayne avatar

Stargazers

mickyChan avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.