美文网首页疯狂iOS
Xcodebuild 打包脚本

Xcodebuild 打包脚本

作者: 执拗的男孩 | 来源:发表于2019-11-03 00:18 被阅读0次
iOS 打包使用
常用的命令
Xcodebuild -list 返回项目相关的信息
D073841B-361C-4BD7-B52E-B9FCC3C926DD.png
1.使用xcodebuild 和  xcrun
由于xcrun PackageApplication 在xcode8.3版本后已经被废除,所以要使用PackageApplication打包需要将PackageApplication脚本拷贝到路径/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/下
同时执行命令 chmod +x /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/PackageApplication 
chmod +x 是设定PackageApplication 脚本可执行

脚本范例:
.清理工程
xcodebuild clean 

.编译工程
xcodebuild -project landwind.xcodeproj -target landwind -configuration Release 

.导出包
xcrun -sdk iphoneos -v PackageApplication build/Release-iphoneos/landwind.app -o ~/Desktop/landwind.ipa
2.使用xcodebuild 和 xcodebuild -exportArchive
.清理工程
xcodebuild clean 

.编译工程
xcodebuild archive -project landwind.xcodeproj \
-target landwind \
-configuration Release 
-archivePath build/landwind.xcarchive

导包:
xcodebuild -exportArchive -archivePath build/${project_name}.xcarchive \
-configuration ${development_mode} \
CODE_SIGN_IDENTITY=“iPhone Distribution: JIANGLING MOTOR HOLDING CO .,LTD” \
PROVISIONING_PROFILE=“iOS Team Provisioning Profile: jlkg_tima2” \
-exportPath ${exportFilePath} \
-exportOptionsPlist ${exportOptionsPlistPath} \
-quiet || exit

注:exportOptionsPlist  指定用于签名的profile文件
格式如下:
<?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>provisioningProfiles</key>
      <dict>
      <key>cn.com.jlkg.kkplus</key>
        <string>jlkg_tima2</string>
        </dict>
    <key>compileBitcode</key>  
    <false/>
    <key>method</key>
        <string>enterprise</string>
</dict>
</plist>
上传到蒲公英命令
curl -F “file=@/Users/allpe/Desktop/att/landwind.ipa” \ -F “uKey=b04b19c72f760383e709becc39da1713” \ -F “_api_key=1ca577054778a281668908190024ccae” \ https://www.pgyer.com/apiv1/app/upload

curl -F "file=@/Users/allpe/Desktop/att/landwind.ipa" -F "uKey=b04b19c72f760383e709becc39da1713" -F "_api_key=1ca577054778a281668908190024ccae" 
https://qiniu-storage.pgyer.com/apiv1/app/upload

相关文章

网友评论

    本文标题:Xcodebuild 打包脚本

    本文链接:https://www.haomeiwen.com/subject/axqkbctx.html