Giter VIP home page Giter VIP logo

xcodebuild's Introduction

先cd到项目的根目录

第一步:归档生成.xcarchive

方法一:使用自动签名功能进行归档

xcodebuild -project <XXX.xcodeproj所在路径> -archivePath <XXX.xcarchive所在路径> -scheme <Scheme名字> -configuration <Debug或Release> -sdk iphoneos archive DEVELOPMENT_TEAM="<TeamID>"

-project 指向xcode工程文件的路径
-archivePath 导出的归档的文件路径
-scheme 项目的scheme名字
-configuration 通常设置Debug或者Release
-DEVELOPMENT_TEAM 苹果开发者团队TEAMID

方法二:使用手动添加证书、描述文件进行归档

xcodebuild -project <XXX.xcodeproj所在路径> -archivePath <XXX.xcarchive所在路径> -scheme <Scheme名字> -configuration <Debug或Release> -sdk iphoneos archive DEVELOPMENT_TEAM="<TeamID>" CODE_SIGN_IDENTITY="<证书名字>" PROVISIONING_PROFILE_SPECIFIER="<描述文件名字>"

-project 指向xcode工程文件的路径
-archivePath 导出的归档的文件路径(包含文件夹和文件名)
-scheme 项目的scheme名字(xcode -> product -> scheme)
-configuration 通常设置Debug或者Release
-DEVELOPMENT_TEAM 苹果开发者团队TEAMID(在苹果开发者网站上查看teamid)
-CODE_SIGN_IDENTITY 证书名字(一定要去钥匙串里复制粘贴正确的证书名,注意包含前缀如iPhone Distribution: ,iPhone Developer:,全名如:iPhone Distribution: Jiangsu Qianmi Network Technology Co., Ltd.)
-PROVISIONING_PROFILE_SPECIFIER 描述文件的名字(苹果开发者网站,Provisioning Profiles对应的名称)

第二步:通过.xcarchive生成.ipa

xcodebuild -exportArchive -archivePath <XXX.xcarchive所在路径> -exportPath <导出.ipa的路径> -exportOptionsPlist <XXX.plist所在路径>

-archivePath 导出的归档的文件路径
-exportPath 想要导出.ipa文件的路径
-exportOptionsPlist plist文件所在的位置(不是info.plist,这是xcode8.3后不支持-exportFormat命令后,改成用plist文件来支持了)

测试环境plist文件

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
    <dict>
        <key>method</key>
        <string>development<string>
    </dict>
</plist>

正式环境plist文件

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
    <dict>
        <key>method</key>
        <string>app-store<string>
        <key>teamID</key>
        <string>你的苹果开发者团队ID<string>
    </dict>
</plist>

参考文章看这里

#####examble########

生成归档文件 xxx.xcarchive

xcodebuild -project /Users/yclxiao/Project/elifehome/ios/elifehome.xcodeproj -archivePath /Users/yclxiao/Project/elifehome/ios/elifehome.xcarchive -scheme elifehome -configuration Release -sdk iphoneos archive DEVELOPMENT_TEAM="SFSFH6NHYB" CODE_SIGN_IDENTITY="iPhone Distribution: Jiangsu Qianmi Network Technology Co., Ltd." PROVISIONING_PROFILE_SPECIFIER="ehome"

生成ipa文件   xxx.ipa

xcodebuild -exportArchive -archivePath /Users/yclxiao/Project/elifehome/ios/elifehome.xcarchive -exportPath /Users/yclxiao/Project/elifehome/ios/elifehome.ipa -exportOptionsPlist /Users/yclxiao/Project/elifehome/ios/export.plist

export.plist的内容如下:

`

teamID XXXXXXX method enterprise compileBitcode uploadSymbols `

xcodebuild's People

Contributors

yclxiao avatar zhang382847657 avatar

Stargazers

 avatar

Watchers

James Cloos avatar  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.