[iOS]Xcode升级到Xcode9,xcodebuild -exportArchive导出ipa文件exportOptionsPlist

2017年12月09日 iOS 18条评论 阅读3599次

[iOS]Xcode升级到Xcode9,xcodebuild -exportArchive导出ipa文件exportOptionsPlist


之前做的打包ipa用的shell文件,好久没使用了,今天拿出来看看还好用不。
由于Xcode的版本升级,现在已经是Xcode9了,之前Xcode7下的命令还确实发生问题了。


问题:xcrun中PackageApplication不再可用

较老版本的打包ipa命令中我们经常是xcodebuild + xcrun 配合,先生成xcarchive,在导出为ipa,但现在使用xcrun 后有了这个错误:

xcrun: error: unable to find utility "PackageApplication", not a developer tool or in PATH


网上说现在新版本的Xcode已经删除PackageApplication了,PackageApplication在前几个版本已被废弃,从Xcode8.3开始彻底删除了。

相应的对策:在旧版本的Xcode的/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/下能找到PackageApplication这个文件,可以复制这个文件到当前使用的Xcode相应目录下,或从网上下载该文件。然后执行命令:



sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer/
chmod +x /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/PackageApplication

苹果已经删除的东西最好还是不要继续使用了,接下来探索新的方法。

在终端中输入xcodebuild -help之后


xcodebuild-help.png

xcodebuild [-project <projectname>] [[-target <targetname>]...|-alltargets] [-configuration <configurationname>] [-arch <architecture>]... [-sdk [<sdkname>|<sdkpath>]] [-showBuildSettings] [<buildsetting>=<value>]... [<buildaction>]...
       xcodebuild [-project <projectname>] -scheme <schemeName> [-destination <destinationspecifier>]... [-configuration <configurationname>] [-arch <architecture>]... [-sdk [<sdkname>|<sdkpath>]] [-showBuildSettings] [<buildsetting>=<value>]... [<buildaction>]...
       xcodebuild -workspace <workspacename> -scheme <schemeName> [-destination <destinationspecifier>]... [-configuration <configurationname>] [-arch <architecture>]... [-sdk [<sdkname>|<sdkpath>]] [-showBuildSettings] [<buildsetting>=<value>]... [<buildaction>]...
       xcodebuild -version [-sdk [<sdkfullpath>|<sdkname>] [<infoitem>] ]
       xcodebuild -list [[-project <projectname>]|[-workspace <workspacename>]] [-json]
       xcodebuild -showsdks
       xcodebuild -exportArchive -archivePath <xcarchivepath> -exportPath <destinationpath> -exportOptionsPlist <plistpath>
       xcodebuild -exportLocalizations -localizationPath <path> -project <projectname> [-exportLanguage <targetlanguage>...]
       xcodebuild -importLocalizations -localizationPath <path> -project <projectname>



发现有xcodebuild -exportArchive -archivePath <xcarchivepath> -exportPath <destinationpath> -exportOptionsPlist <plistpath>的一个命令

根据提示配置即可,值得注意的是最后一个exportOptionsPlist参数。

exportOptionsPlist没从苹果官网上找到相关资料,好在全网中有前辈已经探出一条路来,用网上提供的plist文件,出现了各种各样错误。
听说自己手动在Xcode9中Archive并且导出一次,在保存ipa的文件夹下,除ipa文件之外,还有两个plist文件,其中ExportOptions.plist就是命令行参数中需要指定的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>compileBitcode</key>
    <false/>
    <key>method</key>
    <string>enterprise</string>
    <key>provisioningProfiles</key>
    <dict>
        <key>net.jileniao.app【应用BundleID】</key>
        <string>net.jileniao.app_dis【描述文件名称】</string>
    </dict>
    <key>signingCertificate</key>
    <string>iPhone Distribution</string>
    <key>signingStyle</key>
    <string>manual</string>
    <key>stripSwiftSymbols</key>
    <true/>
    <key>teamID</key>
    <string>H1PWD0G6DA</string>
    <key>thinning</key>
    <string>&lt;none&gt;</string>
</dict>
</plist>


这样,最后把我的整个shell文件贴出来。



#!/bin/bash
#Author jileniao.net
SCHEMENAME='JILENIAO.NET'
DATE=`date +%Y%m%d_%H%M`
SOURCEPATH=$( cd "$( dirname $0 )" && pwd)
IPAPATH=$SOURCEPATH
DISNAME=$SCHEMENAME"_"$DATE
ARCHNAME=$DISNAME.xcarchive
IPANAME=$DISNAME
#rm -rf ./build
#构建
xcodebuild archive \
 -project JILENIAO.NET.xcodeproj \
 -scheme JILENIAO.NET \
 -configuration Release \
 -archivePath $ARCHNAME \
 clean \
 build \
 -derivedDataPath ./
if [ -e $ARCHNAME ]; then
  echo "xcodebuild archive Successful"
else
  echo "xcodebuild archive Failed"
  exit 1
fi
#生成ipa
xcodebuild -exportArchive \
 -archivePath $ARCHNAME \
 -exportPath $IPANAME \
 -exportOptionsPlist ./ExportOptions.plist
if [ -e $IPANAME ]; then
  echo "Export ipa Successful"
  open $IPAPATH
else
  echo "Export ipa Failed"
fi







分享本文至:

WRITTEN BY

avatar
本文标签:XCodexcodebuild
看了本文是不是觉得很赞,那就赶紧点击下面按钮分享给身边的朋友吧!

18 条评论

  1. <a href="http://www.crowleyarms.com/women-mackage-pant-and-skirt-mackageb">women mackage pant and skirt</a> <a href="http://www.toptopprinter.com/tory-burch-camel-boots-toryburchr">tory burch camel boots</a> <a href="http://www.tridenttrump.com/billig-nike-free-flyknit-5.0-herre-gr%C3%B8n-runningd">billig nike free flyknit 5.0 herre gr酶n</a> <a href="http://www.ceeditsesame.com/red-mackage-coat-mackager">red mackage coat</a> <a href="http://www.ritaburton.com/michael-kors-handbags-vanilla-leather-zone-mke">michael kors handbags vanilla leather zone</a> <a href="http://www.blanchardsvac.com/moncler-acorus-down-moto-jacket-uk-monclerd">moncler acorus down moto jacket uk</a>
    whylux http://www.whylux.com/

  2. <a href="http://www.ericaamadori.com/nike-mens-kellen-winslow-limited-navy-blue-jersey-los-angeles-chargers-nfl-80-tank-top-suit-nflx">nike mens kellen winslow limited navy blue jersey los angeles chargers nfl 80 tank top suit</a> <a href="http://www.minnfluencer.com/nike-kobe-vii-for-vendita-nc-kurpesc">nike kobe vii for vendita nc</a> <a href="http://www.modambalaj.com/braves-29-john-smoltz-red-cool-base-stitched-mlb-jersey-nflx">braves 29 john smoltz red cool base stitched mlb jersey</a> <a href="http://www.modnypixel.com/adidas-springblade-ignite-marine-obuve">adidas springblade ignite marine</a> <a href="http://www.occformacion.com/nike-huarache-nero-grigio-scarpec">nike huarache nero grigio</a> <a href="http://www.servicioswom.com/bl%C3%A5-gr%C3%A5-nike-free-run3-5.0-kvinners-sko-for-salg-kurpesb">bl氓 gr氓 nike free run3 5.0 kvinners sko for salg</a>
    marijuanapier http://www.marijuanapier.com/

  3. <a href="http://www.truthtapes.com/nike-kd-8-high-rosso-verde-scarpel">nike kd 8 high rosso verde</a> <a href="http://www.veskopetrov.com/nike-roshe-run-hyp-silver-white-shoesj">nike roshe run hyp silver white</a> <a href="http://www.kaosmotogp.com/nike-lebron-12-low-photo-bl%C3%A5-skok">nike lebron 12 low photo bl氓</a> <a href="http://www.doularhythms.com/ua-curry-3-gul-rosa-obuvp">ua curry 3 gul rosa</a> <a href="http://www.animalpainvet.com/air-jordan-retro-9-womens-mint-green-red-shoesi">air jordan retro 9 womens mint green red</a> <a href="http://www.texarillo.com/air-jordan-imminent-guld-hvid-skoj">air jordan imminent guld hvid</a>
    artpreneure http://www.artpreneure.com/

  4. <a href="http://www.kbowendesign.com/nike-kobe-8-for-salg-jacksonville-fl-schuheg">nike kobe 8 for salg jacksonville fl</a> <a href="http://www.naifenma.com/herren-ralph-lauren-pony-shorts-beige-gelb-polou">herren ralph lauren pony shorts beige gelb</a> <a href="http://www.nowosadko.com/nike-air-max-bw-kvinners-s%C3%B8lv-oransje-chaussuresa">nike air max bw kvinners s酶lv oransje</a> <a href="http://www.sdsremote.com/nike-cortez-violet-hommes-schuhee">nike cortez violet hommes</a> <a href="http://www.advitil.com/nike-max-zero-b%C3%B8rn-hvid-gr%C3%A5-scarpea">nike max zero b酶rn hvid gr氓</a> <a href="http://www.cutlaroc.com/air-jordan-10-hvid-lyser%C3%B8d-kurpesf">air jordan 10 hvid lyser酶d</a>
    carslambert http://www.carslambert.com/

  5. <a href="http://www.cardiachits.com/air-jordan-retro-3-violet-hommesthe-verte-chaussuresh">air jordan retro 3 violet hommesthe verte</a> <a href="http://www.zestchannel.com/nike-lebron-12-mujeres-p%C3%BArpura-rosado-zapatosp">nike lebron 12 mujeres p煤rpura rosado</a> <a href="http://www.eczacinim.com/nike-air-max-tailwind-7-black-silver-shoesi">nike air max tailwind 7 black silver</a> <a href="http://www.chilangorails.com/dam%C3%A4nner-air-jordan-retro-10-orangen-gold-schuhei">dam盲nner air jordan retro 10 orangen gold</a> <a href="http://www.mariusen.com/hombres-nike-roshe-run-high-naranja-gris-zapatosk">hombres nike roshe run high naranja gris</a> <a href="http://www.brittonoilco.com/kvinders-nike-flynit-air-max-lyser%C3%B8d-guld-skoi">kvinders nike flynit air max lyser酶d guld</a>
    scopatore http://www.scopatore.com/

  6. <a href="http://www.eworklife.com/womens-nike-huarache-utility-black-denmark-shoeso">womens nike huarache utility black denmark</a> <a href="http://www.fullcountkbo.com/nike-lunarglide-6-jaune-violet-kurpesb">nike lunarglide 6 jaune violet</a> <a href="http://www.shackofstones.com/retro-basketball-shoes-zapatost">retro basketball shoes</a> <a href="http://www.tamworthbacon.com/girls-high-converse-shoesz">girls high converse</a> <a href="http://www.dvmengineers.com/mennns-nike-free-run-3.0-v6-hvit-bl%C3%A5-schuhec">mennns nike free run 3.0 v6 hvit bl氓</a> <a href="http://www.questoffine.com/youth-nike-dallas-cowboys-11-cole-beasley-limited-white-rush-vapor-untouchable-nfl-jersey-nflu">youth nike dallas cowboys 11 cole beasley limited white rush vapor untouchable nfl jersey</a>
    acforlessllc http://www.acforlessllc.com/

  7. <a href="http://www.laketreepress.com/prada-fringe-backpack-pradah">prada fringe backpack</a> <a href="http://www.prohaarklinik.com/kam-chancellor-seattle-seahawks-jersey-nfli">kam chancellor seattle seahawks jersey</a> <a href="http://www.bonfanticare.com/kvinders-nike-zoom-structure-18-appelsin-gr%C3%A5-skol">kvinders nike zoom structure 18 appelsin gr氓</a> <a href="http://www.antoniopagni.com/long-sleeve-sports-polo-shirts-poloh">long sleeve sports polo shirts</a> <a href="http://www.wcshosting.com/mens-nike-roshe-run-hyp-pink-gold-shoesi">mens nike roshe run hyp pink gold</a> <a href="http://www.biddingstream.com/nike-free-tr-womens-black-green-shoesp">nike free tr womens black green</a>
    findatrans http://www.findatrans.com/

  8. avatar ericwinzenried

    <a href="http://www.txmed.net/nike-huarache-wei%C3%9F-and-gold-kurpesb">nike huarache wei脽 and gold</a> <a href="http://www.ukpubs.net/nike-free-run-3.0-amarillo-schuhee">nike free run 3.0 amarillo</a> <a href="http://www.uniquewebsitedesign.net/nike-lunarglide-8-binary-azul-line-butyd">nike lunarglide 8 binary azul line</a> <a href="http://www.unratedperez.net/air-jordan-6-rosa-gr%C3%A5-obuvc">air jordan 6 rosa gr氓</a> <a href="http://www.urbanintelligence.net/nike-vomero-chaussures-vente-scarpee">nike vomero chaussures vente</a> <a href="http://www.utsweb.net/adidas-pr%C3%B8dator-powerswerve-precio-obuvd">adidas pr酶dator powerswerve precio</a>
    ericwinzenried http://www.ericwinzenried.net/

  9. avatar ozoessaouira

    <a href="http://www.agichipay.com/womens-nike-atlanta-falcons-36-kemal-ishmael-game-red-team-color-nfl-jersey-nflu">womens nike atlanta falcons 36 kemal ishmael game red team color nfl jersey</a> <a href="http://www.millsbulb.com/nike-air-max-thea-olive-green-womens-skou">nike air max thea olive green womens</a> <a href="http://www.hamshrd.com/adidas-zx-flux-estate-2015-runninge">adidas zx flux estate 2015</a> <a href="http://www.lroyroofing.com/jordan-adidasi-zapatosu">jordan adidasi</a> <a href="http://www.golfbodyshop.com/nike-internationalist-jcrd-woven-gr%C3%A5-lyser%C3%B8d-hvid-chaussuresa">nike internationalist jcrd woven gr氓 lyser酶d hvid</a> <a href="http://www.yufnsyb.com/nike-giants-87-sterling-shepard-green-stitched-limited-salute-to-service-jersey-nfle">nike giants 87 sterling shepard green stitched limited salute to service jersey</a>
    ozoessaouira http://www.ozoessaouira.com/

  10. avatar eskortpu

    <a href="http://www.tryautolikes.com/yeezy-boost-950-cheap-quality-footc">yeezy boost 950 cheap quality</a> <a href="http://www.bigbigk.com/nike-flyknit-boots-skox">nike flyknit boots</a> <a href="http://www.gmanswindle.com/billig-new-balance-574-dam%C3%A4nner-grau-sportsd">billig new balance 574 dam盲nner grau</a> <a href="http://www.ambitionagent.com/coach-crimson-wallet-coachr">coach crimson wallet</a> <a href="http://www.cheryberber.com/oklahoma-city-thunder-jersey-nflb">oklahoma city thunder jersey</a> <a href="http://www.wlstoday.com/air-max-2015-men-2015-volt-sportsb">air max 2015 men 2015 volt</a>
    eskortpu http://www.eskortpu.com/

  11. avatar yankaripark

    <a href="http://www.mikespothole.com/adidas-samba-mens-zapatost">adidas samba mens</a> <a href="http://www.theclaydoctor.com/white-leather-converse-shoesz">white leather converse</a> <a href="http://www.allthatspool.com/adidas-damian-lillard-2-bl%C3%A5-gul-schuheb">adidas damian lillard 2 bl氓 gul</a> <a href="http://www.ihavewed.com/youth-nike-denver-broncos-61-matt-paradis-orange-team-color-vapor-untouchable-limited-player-nfl-jersey-nflu">youth nike denver broncos 61 matt paradis orange team color vapor untouchable limited player nfl jersey</a> <a href="http://www.cloudsmartin.com/nike-w-air-max-bw-skou">nike w air max bw</a> <a href="http://www.myachingoa.com/air-max-1-woman-womens-runningf">air max 1 woman womens</a>
    yankaripark http://www.yankaripark.com/

  12. avatar dumaworks

    <a href="http://www.audioacousticart.net/air-jordan-retro-10-oransje-gull-kurpesa">air jordan retro 10 oransje gull</a> <a href="http://www.auditionrush.net/nike-lunarglide-8-dam%C3%A4nner-orange-rot-kurpesc">nike lunarglide 8 dam盲nner orange rot</a> <a href="http://www.autismy.net/air-max-thea-noir-and-rouge-obuva">air max thea noir and rouge</a> <a href="http://www.automotoracing.net/dam%C3%A4nner-nike-air-force-1-rosa-orange-schuhef">dam盲nner nike air force 1 rosa orange</a> <a href="http://www.ave-koeln.net/adidas-yeezy-boost-350-kinder-gold-lila-chaussuresg">adidas yeezy boost 350 kinder gold lila</a> <a href="http://www.awffull.net/jordan-flight-23-schwarz-rosa-obuvd">jordan flight 23 schwarz rosa</a>
    dumaworks http://www.dumaworks.net/

  13. avatar instanalo

    <a href="http://www.georgesherry.com/new-york-yankees-hat-gang-weatherproof-hata">new york yankees hat gang weatherproof</a> <a href="http://www.jenalgroup.com/purple-gold-mens-nike-zoom-all-out-shoes-runninge">purple gold mens nike zoom all out shoes</a> <a href="http://www.badacamshotel.com/nike-classic-cortez-nylon-gray-bianca-schuhea">nike classic cortez nylon gray bianca</a> <a href="http://www.compressmyjs.com/nike-foamposite-one-r%C3%B8d-metalleic-scarpeb">nike foamposite one r酶d metalleic</a> <a href="http://www.fetison.com/womens-nike-huarache-utility-black-denmark-shoeso">womens nike huarache utility black denmark</a> <a href="http://www.neffloot.com/adidas-pr%C3%B8dator-incurza-sports-direct-kurpesc">adidas pr酶dator incurza sports direct</a>
    instanalo http://www.instanalo.com/

  14. avatar mylinkstv

    <a href="http://www.rellthewolf.com/kvinners-new-balance-360-s%C3%B8lv-kurpesb">kvinners new balance 360 s酶lv</a> <a href="http://www.fincasagaro.com/cheap-pink-pumas-zapatost">cheap pink pumas</a> <a href="http://www.mushigiftpack.com/white-leather-converse-shoesz">white leather converse</a> <a href="http://www.glplawyers.com/nike-air-max-1-anthracite-wolf-grigio-schuheb">nike air max 1 anthracite wolf grigio</a> <a href="http://www.canditatenext.com/nike-limited-chris-carson-jersey-32-nfl-seattle-seahawks-rush-fashion-womens-white-pink-nflu">nike limited chris carson jersey 32 nfl seattle seahawks rush fashion womens white pink</a> <a href="http://www.ganuocdua.com/nike-roshe-one-hi-skou">nike roshe one hi</a>
    mylinkstv http://www.mylinkstv.com/

  15. avatar golfbodyshop

    <a href="http://www.dianaandwill.com/paul-george-2016-s%C3%B8lv-hvit-scarpeb">paul george 2016 s酶lv hvit</a> <a href="http://www.newagecharger.com/womens-nike-air-max-bw-white-netherlands-shoeso">womens nike air max bw white netherlands</a> <a href="http://www.foliekopen.com/femminile-nike-free-tr-fit-gituttio-viola-kurpesb">femminile nike free tr fit gituttio viola</a> <a href="http://www.milapioffret.com/cool-jordan-shoes-names-zapatost">cool jordan shoes names</a> <a href="http://www.kalraslan.com/white-leather-converse-shoesz">white leather converse</a> <a href="http://www.umuttekelbayi.com/jordan-5-schwarz-wei%C3%9F-grau-schuheb">jordan 5 schwarz wei脽 grau</a>
    golfbodyshop http://www.golfbodyshop.com/

  16. avatar alistauction

    <a href="http://www.kbowendesign.com/lunarglide-6-gr%C3%B8nn-quarters-kurpesf">lunarglide 6 gr酶nn quarters</a> <a href="http://www.naifenma.com/mennns-big-pony-polo-gr%C3%A5-marinen-polou">mennns big pony polo gr氓 marinen</a> <a href="http://www.nowosadko.com/salomon-xt-hornet-herre-gul-scarpeb">salomon xt hornet herre gul</a> <a href="http://www.sdsremote.com/jim-mcmahon-navy-blue-nike-nfl-chicago-bears-t-shirt-name-number-logo-9-nfls">jim mcmahon navy blue nike nfl chicago bears t shirt name number logo 9</a> <a href="http://www.advitil.com/air-jordan-aero-mania-bleu-blanc-scarpeg">air jordan aero mania bleu blanc</a> <a href="http://www.cutlaroc.com/flyknit-lunar-2-l%C3%B8b-sko-obuvd">flyknit lunar 2 l酶b sko</a>
    alistauction http://www.alistauction.com/

  17. avatar n1jvmtjv

    <a href="http://www.33ocbhxx.com/nike-air-jordan-8-retro-schwarz-chrome-for-verkauf-obuvb">nike air jordan 8 retro schwarz chrome for verkauf</a> <a href="http://www.ou5cxgy0.com/air-jordan-11-retro-zapatillas-kurpesa">air jordan 11 retro zapatillas</a> <a href="http://www.5m9w6ysn.com/a-buon-mercato-nike-free-5.0-v2-nero-bianca-butyc">a buon mercato nike free 5.0 v2 nero bianca</a> <a href="http://www.6iqdfvgi.com/adidas-springblade-razor-noir-butye">adidas springblade razor noir</a> <a href="http://www.nfnl51ta.com/nike-free-run-blau-kurpesd">nike free run blau</a> <a href="http://www.p4vepcy8.com/jordan-3-sort-cem%C3%A6ndt-online-schuhea">jordan 3 sort cem忙ndt online</a>
    [url=http://www.n1jvmtjv.com/]n1jvmtjv[/url]

  18. avatar juliemobley

    <a href="http://www.truenthusiast.com/game-al-woods-jersey-tennessee-titans-96-alternate-navy-blue-nflb">game al woods jersey tennessee titans 96 alternate navy blue</a> <a href="http://www.nrthofhere.com/jordan-12-red-october-gamma-skoc">jordan 12 red october gamma</a> <a href="http://www.ksjfifgmif.com/burberry-womens-cashmere-scarf-scarfr">burberry womens cashmere scarf</a> <a href="http://www.gbwpvqyg.com/bon-march%C3%A9-nike-air-max-95-hommes-jaune-sneakerc">bon march茅 nike air max 95 hommes jaune</a> <a href="http://www.alannacaldas.com/zx-flux-multicolor-prisms-shoesc">zx flux multicolor prisms</a> <a href="http://www.lmbaidu.com/ray-ban-aviator-polarized-lenses-sunglassesr">ray ban aviator polarized lenses</a>
    juliemobley http://www.juliemobley.com/

欢迎留言




用户登录

sitemap