Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

支持xcode8的archive打包 #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

BirdandLion
Copy link

@BirdandLion BirdandLion commented Oct 28, 2016

1. 修改mainPath,方便用户修改target_path目录
mainPath = commendPath + 'Documents' + '/' + tempFinder

改为:

mainPath = target_path + '/' + tempFinder
2. 修改tag,去掉默认操作master分支,改为操作全局设置的tag分支
global tag
tag = options.tag

改为:

# global tag
# tag = options.tag
3. 修改 git clone, 复制整个仓库,方便切换分支
os.system ('git clone %s %s --depth 1'%(gitPath,mainPath))

改为:

os.system ('git clone %s %s'%(gitPath,mainPath))
4. 修改build方式,改用archive方式,xcode8以后改用此方式打包
if isWorkSpace:
        os.system("cd %s;xcodebuild -workspace %s.xcworkspace -scheme %s CODE_SIGN_IDENTITY='%s' -derivedDataPath build/"%(mainPath,targetName,targetName,certificateName))
    else:
        os.system("cd %s;xcodebuild -target %s CODE_SIGN_IDENTITY='%s'"%(mainPath,targetName,certificateName))

改为:

os.system ("cd %s;rm -r -f %s.xcarchive"%(mainPath,targetName))
    if isWorkSpace:
        os.system("cd %s;xcodebuild archive -workspace %s.xcworkspace -scheme %s -configuration Release -archivePath %s/%s"%(mainPath,targetName,targetName,mainPath,targetName))
    else:
        os.system("cd %s;xcodebuild archive -target %s -configuration Release -archivePath %s"%(mainPath,targetName,mainPath))
5. 修改ipa打包方式
os.system ("cd %s;xcrun -sdk iphoneos PackageApplication -v %s/build/Build/Products/Debug-iphoneos/%s.app -o %s/%s.ipa CODE_SIGN_IDENTITY='%s'"%(mainPath,mainPath,targetName,mainPath,targetName,certificateName))

改为:

os.system ("cd %s;xcodebuild -exportArchive -archivePath ./%s.xcarchive -exportPath %s/ -exportOptionsPlist chaoaicai.plist"%(mainPath,targetName,mainPath))
6. 创建plist文件,打包之前需创建 targetName.plist 文件, 放到需要打包的目录下

  其中, plist文件各个字段含义如下:

  • compileBitcode 字段是不生成bitcode代码
  • method 字段是生成的ipa包的类型,可选的类型有 app-store, package, ad-hoc, enterprise, development, and developer-id
  • teamID 证书的ID
<?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>compileBitcode</key>
    <false/>
    <key>method</key>
    <string>enterprise</string>
    <key>teamID</key>
    <string>3YX5LBJJ78</string>
</dict>
</plist>

2. 修改tag,去掉默认操作master分支,改为操作全局设置的tag分支
3. 修改 git clone, 复制整个仓库,方便切换分支
4. 修改build方式,改用archive方式,xcode8以后改用此方式打包
5. 修改ipa打包方式
@BirdandLion
Copy link
Author

增加了xcode8的archive打包功能

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant