iOS自動打包

首先感謝CaryaLiu's Blog關于iOS自動打包并發布的博文,讓我打開了新世界的大門。

之前的打包模式

最開始剛到這個公司的時候,同事是這樣打包的。
測試:給我測試機打個包,測試一下。
開發:好。
(然后一臺臺手機拿過來,插到電腦上,biubiubiu,一臺臺裝上去。。

開發:你說的bug改完了,我給你打個新包吧。
(然后一臺臺手機拿過來,插到電腦上,biubiubiu,一臺臺裝上去。。還好公司窮,測試機就一臺,還是測試自己的hhhh但是其他同事啊領導想要的時候,又得一臺臺拿過來一個個插一遍運行一遍)

之后大概一年前,我們發現了“蒲公英”這個平臺,開始了AD-Hot模式的打包,相對于之前有人要裝就得把手機拿過來插一遍要省事一些了。
從“biubiubiu每臺手機插一遍”到了“我點點點,導出,上傳,,,,啊好了,你們要裝新版本的話從蒲公英下啊”“蒲公英有新版本了,你們看到APP內提示直接升級就可以啦”這樣的。但是這樣也有麻煩的地方,如果只改了一點點小bug但是又要打包的時候,那我們又要開始“點點點,導出,上傳”每次至少耗時5分鐘,時間雖然不多,但是操作還是略繁瑣,特別是那等待時間,只能傻傻的等。
測試:打包好了嘛?
我:還沒,等會。
測試:打包好了沒?
我:還沒,在緩沖。
測試:好了沒啊,我要開始測了啊。
我:快了,在上傳了。
雖然,蒲公英節省了安裝的時間,但是我們打包的時間相應增加了。
既然安卓能有自動打包的工具,那么為什么iOS不能有呢?懷著這樣的心情,昨天用了一天時間查閱相關資料和方法,找到了一個可行的方法,并成功打了一個包,雖然自動上傳到蒲公英失敗了。等研究了Python再看看上傳時候弄錯了什么。
順便,同時在蒲公英上發現了新大陸,蒲公英API介紹

我們要明白,我們的可視化操作,在代碼層都是能找到相應代碼進行操作的,那么,我們在Xcode里點點點導出ipa包的時候,Xcode做了什么呢?
沒錯,xcodebuild命令。
為了避免錯誤操作對公司重要工程造成莫名其妙的影響,我們先創建一個test的項目,隨便寫點什么甚至空白也行。
cd到相應目錄,試一下xcodebuild命令。

巴拉巴拉跳出一大堆打印,剔除無用信息之后,如下
=== BUILD TARGET xcodebuildTest OF PROJECT xcodebuildTest WITH THE DEFAULT CONFIGURATION (Release) ===

Check dependencies
Write auxiliary files
//一大堆依賴文件

Create product structure
/bin/mkdir -p /Users/TyW/Documents/GitHub/xcodebuildTest/build/Release-iphoneos/xcodebuildTest.app
·
·
·
·
Validate build/Release-iphoneos/xcodebuildTest.app
    cd /Users/TyW/Documents/GitHub/xcodebuildTest
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Library/Frameworks/Python.framework/Versions/3.5/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/TyW/.rvm/bin"
    export PRODUCT_TYPE=com.apple.product-type.application
    builtin-validationUtility /Users/TyW/Documents/GitHub/xcodebuildTest/build/Release-iphoneos/xcodebuildTest.app -validate-for-store

** BUILD SUCCEEDED **

哈?什么,這樣就已經** BUILD SUCCEEDED **了,回到響應目錄一看,還真的多了一個文件夾

剛才xcodebuild出來的文件夾.png

既然已經build出了.app文件,那么接下來將.app文件轉換成.ipa文件

//在終端輸入以下命令
xcrun -sdk iphoneos -v PackageApplication ./build/Release-iphoneos/xcodebuildTest.app -o ~/Desktop/xcodebuildTest.ipa

就看到唰唰唰一排打印過后,在桌面看到.ipa文件,但是也看到終端中有這樣的提示warning: PackageApplication is deprecated, usexcodebuild -exportArchiveinstead.,這告訴我們PackageApplication的方式已經廢棄了,應該用xcodebuild -exportArchive代替。
那么,經過上述的步驟,最簡單的工程已經能快速打包了,那么像正常的工程很多framework很多pod的是否也可以打包了呢。一試便知。

同樣cd到相應目錄,鍵入xcodebuild命令,
唰唰唰打印了三分鐘,最終

** BUILD FAILED **


The following build commands failed:
    Ld build/PaopaoRunning.build/Release-iphoneos/PaopaoRunning.build/Objects-normal/armv7/xxxx normal armv7
    Ld build/PaopaoRunning.build/Release-iphoneos/PaopaoRunning.build/Objects-normal/arm64/xxxx normal arm64

果不其然,打包失敗了,按照理解是這兩種編碼方式沒能適配,那么,我們還是來看一下xcodebuild的幫助文檔吧,應該能找到相關的設置的,畢竟咱們全新的空白文檔是能夠打包成功的。
然后我們的目標是沒有蛀牙,啊不對,是用ad-hot模式打包出ipa并上傳到蒲公英。

閱讀xcodebuild幫助并了解

在終端輸入man xcodebuild命令查看其man page,蹦出來老長一篇文章,如下,


XCODEBUILD(1)             BSD General Commands Manual            XCODEBUILD(1)

NAME
     xcodebuild -- build Xcode projects and workspaces

SYNOPSIS
     xcodebuild [-project name.xcodeproj]
                [[-target targetname] ... | -alltargets]
                [-configuration configurationname]
                [-sdk [sdkfullpath | sdkname]] [action ...]
                [buildsetting=value ...] [-userdefault=value ...]

     xcodebuild [-project name.xcodeproj] -scheme schemename
                [[-destination destinationspecifier] ...]
                [-destination-timeout value]
                [-configuration configurationname]
                [-sdk [sdkfullpath | sdkname]] [action ...]
                [buildsetting=value ...] [-userdefault=value ...]

     xcodebuild -workspace name.xcworkspace -scheme schemename
                [[-destination destinationspecifier] ...]
                [-destination-timeout value]
                [-configuration configurationname]
                [-sdk [sdkfullpath | sdkname]] [action ...]
                [buildsetting=value ...] [-userdefault=value ...]

     xcodebuild -version [-sdk [sdkfullpath | sdkname]] [infoitem]

     xcodebuild -showsdks

     xcodebuild -showBuildSettings
                [-project name.xcodeproj | [-workspace name.xcworkspace -scheme schemename]]

     xcodebuild -list [-project name.xcodeproj | -workspace name.xcworkspace]

     xcodebuild -exportArchive -archivePath xcarchivepath -exportPath
                destinationpath -exportOptionsPlist path

     xcodebuild -exportLocalizations -project name.xcodeproj -localizationPath
                path [[-exportLanguage language] ...]
     xcodebuild -importLocalizations -project name.xcodeproj -localizationPath
                path

DESCRIPTION
     xcodebuild builds one or more targets contained in an Xcode project, or
     builds a scheme contained in an Xcode workspace or Xcode project.

   Usage
     To build an Xcode project, run xcodebuild from the directory containing
     your project (i.e. the directory containing the name.xcodeproj package).
     If you have multiple projects in the this directory you will need to use
     -project to indicate which project should be built.  By default,
     xcodebuild builds the first target listed in the project, with the
     default build configuration. The order of the targets is a property of
     the project and is the same for all users of the project.

     To build an Xcode workspace, you must pass both the -workspace and
     -scheme options to define the build.  The parameters of the scheme will
     control which targets are built and how they are built, although you may
     pass other options to xcodebuild to override some parameters of the
     scheme.

     There are also several options that display info about the installed ver-
     sion of Xcode or about projects or workspaces in the local directory, but
     which do not initiate an action.  These include -list,
     -showBuildSettings, -showsdks, -usage, and -version.

   Options
     -project name.xcodeproj
           Build the project name.xcodeproj.  Required if there are multiple
           project files in the same directory.

     -target targetname
           Build the target specified by targetname.

     -alltargets
           Build all the targets in the specified project.

     -workspace name.xcworkspace
           Build the workspace name.xcworkspace.

     -scheme schemename
           Build the scheme specified by schemename.  Required if building a
           workspace.

     -destination destinationspecifier
           Use the destination device described by destinationspecifier.
           Defaults to a destination that is compatible with the selected
           scheme.  See the Destinations section below for more details.

     -destination-timeout timeout
           Use the specified timeout when searching for a destination device.
           The default is 30 seconds.

     -configuration configurationname
           Use the build configuration specified by configurationname when
           building each target.

     -arch architecture
           Use the architecture specified by architecture when building each
           target.

     -sdk [sdkfullpath | sdkname]
           Build an Xcode project or workspace against the specified SDK,
           using build tools appropriate for that SDK. The argument may be an
           absolute path to an SDK, or the canonical name of an SDK.

     -showsdks
           Lists all available SDKs that Xcode knows about, including their
           canonical names suitable for use with -sdk.  Does not initiate a
           build.

     -showBuildSettings
           Lists the build settings in a project or workspace and scheme. Does
           not initiate a build. Use with -project or -workspace and -scheme.

     -list
           Lists the targets and configurations in a project, or the schemes
           in a workspace. Does not initiate a build. Use with -project or
           -workspace.

     -enableAddressSanitizer [YES | NO]
           Turns the address sanitizer on or off. This overrides the setting
           for the launch action of a scheme in a workspace.

     -enableThreadSanitizer [YES | NO]
           Turns the thread sanitizer on or off. This overrides the setting
           for the launch action of a scheme in a workspace.

     -enableCodeCoverage [YES | NO]
           Turns code coverage on or off during testing. This overrides the
           setting for the test action of a scheme in a workspace.

     -derivedDataPath path
           Overrides the folder that should be used for derived data when per-
           forming an action on a scheme in a workspace.

     -resultBundlePath path
           Writes a bundle to the specified path with results from performing
           an action on a scheme in a workspace.

     -exportArchive
           Specifies that an archive should be exported. Requires
           -archivePath, -exportPath, and -exportOptionsPlist.  Cannot be
           passed along with an action.

     -archivePath xcarchivepath
           Specifies the path for the archive produced by the archive action,
           or specifies the archive that should be exported when
           -exportArchive is passed.

     -exportPath destinationpath
           Specifies the destination for the exported product, including the
           name of the exported file.

     -exportOptionsPlist path
           Specifies options for -exportArchive.  xcodebuild -help can print
           the full set of available options.

     -exportLocalizations
           Exports localizations to XLIFF files. Requires -project and -local-
           izationPath. Cannot be passed along with an action.

     -importLocalizations
           Imports localizations from an XLIFF file. Requires -project and
           -localizationPath. Cannot be passed along with an action.

     -localizationPath
           Specifies a path to a directory or a single XLIFF localization
           file.

     -exportLanguage language
           Specifies optional ISO 639-1 languages included in a localization
           export. May be repeated to specify multiple languages. May be
           excluded to specify an export includes only development language
           strings.

     action ...
           Specify one or more actions to perform. Available actions are:

           build                  Build the target in the build root
                                  (SYMROOT).  This is the default action, and
                                  is used if no action is given.

           build-for-testing      Build the target and associated tests in the
                                  build root (SYMROOT).  This will also pro-
                                  duce an xctestrun file in the build root.
                                  This requires specifying a scheme.

           analyze                Build and analyze a target or scheme from
                                  the build root (SYMROOT).  This requires
                                  specifying a scheme.

           archive                Archive a scheme from the build root
                                  (SYMROOT).  This requires specifying a
                                  scheme.

           test                   Test a scheme from the build root (SYMROOT).
                                  This requires specifying a scheme and
                                  optionally a destination.

           test-without-building  Test compiled bundles. If a scheme is pro-
                                  vided with -scheme then the command finds
                                  bundles in the build root (SRCROOT).  If an
                                  xctestrun file is provided with -xctestrun
                                  then the command finds bundles at paths
                                  specified in the xctestrun file.

           install-src            Copy the source of the project to the source
                                  root (SRCROOT).

           install                Build the target and install it into the
                                  target's installation directory in the dis-
                                  tribution root (DSTROOT).

           clean                  Remove build products and intermediate files
                                  from the build root (SYMROOT).

     -xcconfig filename
           Load the build settings defined in filename when building all tar-
           gets.  These settings will override all other settings, including
           settings passed individually on the command line.

     -xctestrun xctestrunpath
           Specifies test run parameters. Can only be used with the
           test-without-building action. Cannot be used with -workspace or
           -project.   See <x-man-page://5/xcodebuild.xctestrun> for file for-
           mat details.

     -skip-testing:test-identifier, -only-testing:test-identifier
           Constrain test actions.  -only-testing: constrains a test action to
           only  testing a specified identifier, and excluding all other iden-
           tifiers.  -skip-testing: constrains a test action to skip testing a
           specified  identifier,  but  including  all other identifiers. Test
           identifiers have the form  TestTarget[/TestClass[/TestMethod]].  An
           xcodebuild  command  can  combine  multiple constraint options, but
           -only-testing: has precedence over -skip-testing:.

     -dry-run, -n
           Print the commands that would be executed, but do not execute them.

     -skipUnavailableActions
           Skip  actions  that  cannot  be  performed instead of failing. This
           option is only honored if -scheme is passed.

     buildsetting=value
           Set the build setting buildsetting to value.

           A detailed reference of Xcode build settings can be found at:
           <https://developer.apple.com/documentation/DeveloperTools/
           Reference/XcodeBuildSettingRef/>

     -userdefault=value
           Set the user default userdefault to value.

     -toolchain [identifier | name]
           Use a given toolchain, specified with either an identifier or name.

     -quiet
           Do not print any output except for warnings and errors.

     -verbose
           Provide additional status output.

     -version
           Display  version  information  for  this install of Xcode. Does not
           initiate a build. When used in conjunction with -sdk,  the  version
           of  the specified SDK is displayed, or all SDKs if -sdk is given no
           argument.  Additionally, a single  line  of  the  reported  version
           information may be returned if infoitem is specified.


     -license
           Show the Xcode and SDK license agreements. Allows for accepting the
           license agreements without launching Xcode itself, which is  useful
           for headless systems. Must be run as a privileged user.

     -usage
           Displays usage information for xcodebuild.

   Destinations
     The  -destination  option  takes  as its argument a destination specifier
     describing the device (or devices) to use as a destination.   A  destina-
     tion  specifier  is  a single argument consisting of a set of comma-sepa-
     rated key=value pairs.  The -destination option may be specified multiple
     times  to  cause  xcodebuild  to perform the specified action on multiple
     destinations.

     Destination specifiers may include the platform key to specify one of the
     supported  destination platforms.  There are additional keys which should
     be supplied depending on the platform of the device you are selecting.

     Some devices may take time to look up.  The  -destination-timeout  option
     can be used to specify the amount of time to wait before a device is con-
     sidered unavailable.  If unspecified, the default timeout is 30  seconds.

     Currently, xcodebuild supports these platforms:

     macOS              The  local  Mac, referred to in the Xcode interface as
                        My Mac, and which supports the following key:

                        arch  The architecture  to  use,  either  x86_64  (the
                              default) or i386.

     iOS                An iOS device, which supports the following keys:

                        id    The identifier of the device to use, as shown in
                              the Devices window. A valid  destination  speci-
                              fier  must  provide  either  id or name, but not
                              both.

                        name  The name of the device to use. A valid  destina-
                              tion  specifier  must provide either id or name,
                              but not both.

     iOS Simulator      A simulated iOS device, which supports  the  following
                        keys:

                        id    The  identifier  of the simulated device to use,
                              as shown in the Devices window. A valid destina-
                              tion  specifier  must provide either id or name,
                              but not both.

                        name  The name of the simulated device to use. A valid
                              destination  specifier must provide either id or
                              name, but not both.

                        OS    When specifying the simulated  device  by  name,
                              the  iOS version for that simulated device, such
                              as 6.0, or the string latest  (the  default)  to
                              indicate  the  most  recent  version of iOS sup-
                              ported by this version of Xcode.


     watchOS            A watchOS app is  always  built  and  deployed  nested
                        inside  of an iOS app. To use a watchOS device as your
                        destination, specify a scheme which is  configured  to
                        run  a WatchKit app, and specify the iOS platform des-
                        tination that is paired with the  watchOS  device  you
                        want to use.

     watchOS Simulator  A  watchOS  Simulator app is always built and deployed
                        nested inside of  an  iOS  Simulator  app.  To  use  a
                        watchOS  Simulator device as your destination, specify
                        a scheme which is configured to run  a  WatchKit  app,
                        and  specify  the  iOS  Simulator platform destination
                        that is paired with the watchOS Simulator  device  you
                        want to use.

     tvOS               A tvOS device, which supports the following keys:

                        id    The identifier of the device to use, as shown in
                              the Devices window. A valid  destination  speci-
                              fier  must  provide  either  id or name, but not
                              both.

                        name  The name of the device to use. A valid  destina-
                              tion  specifier  must provide either id or name,
                              but not both.

     tvOS Simulator     A simulated tvOS device, which supports the  following
                        keys:

                        id    The  identifier  of the simulated device to use,
                              as shown in the Devices window. A valid destina-
                              tion  specifier  must provide either id or name,
                              but not both.

                        name  The name of the simulated device to use. A valid
                              destination  specifier must provide either id or
                              name, but not both.

                        OS    When specifying the simulated  device  by  name,
                              the tvOS version for that simulated device, such
                              as 9.0, or the string latest  (the  default)  to
                              indicate  the  most  recent version of tvOS sup-
                              ported by this version of Xcode.

     Some actions (such as building) may be performed without an actual device
     present.   To  build against a platform generically instead of a specific
     device, the destination specifier  may  be  prefixed  with  the  optional
     string "generic/", indicating that the platform should be targeted gener-
     ically.  An example of a generic destination is the "Generic iOS  Device"
     destination  displayed  in  Xcode's  UI  when  no  physical iOS device is
     present.


   Exporting Archives
     The -exportArchive option specifies that xcodebuild should export the ar-
     chive   specified   by   -archivePath  using  the  options  specified  by
     -exportOptionsPlist.  xcodebuild -help can print the full set  of  avail-
     able  inputs to -exportOptionsPlist.  The exported product will be placed
     at the path specified by -exportPath.

   Environment Variables
     The following environment variables affect the execution of xcodebuild:

     XCODE_XCCONFIG_FILE
                     Set to a path to a file, build settings in that file will
                     be loaded and used when building all targets.  These set-
                     tings will override all other  settings,  including  set-
                     tings  passed individually on the command line, and those
                     in the file passed with the -xcconfig option.

   Exit Codes
     xcodebuild exits with codes defined by sysexits(3).  It  will  exit  with
     EX_OK on success.  On failure, it will commonly exit with EX_USAGE if any
     options appear malformed, EX_NOINPUT if any input files cannot be  found,
     EX_IOERR  if  any files cannot be read or written, and EX_SOFTWARE if the
     commands given to xcodebuild fail.  It may exit with other codes in  less
     common scenarios.


EXAMPLES
     xcodebuild clean install

              Cleans the build directory; then builds and installs the first
              target in the Xcode project in the directory from which
              xcodebuild was started.

     xcodebuild -project MyProject.xcodeproj -target Target1 -target Target2
              -configuration Debug

              Builds the targets Target1 and Target2 in the project
              MyProject.xcodeproj using the Debug configuration.

     xcodebuild -target MyTarget OBJROOT=/Build/MyProj/Obj.root
              SYMROOT=/Build/MyProj/Sym.root

              Builds the target MyTarget in the Xcode project in the directory
              from which xcodebuild was started, putting intermediate files in
              the directory /Build/MyProj/Obj.root and the products of the
              build in the directory /Build/MyProj/Sym.root.

     xcodebuild -sdk macosx10.6

              Builds the Xcode project in the directory from which xcodebuild
              was started against the macOS 10.6 SDK.  The canonical names of
              all available SDKs can be viewed using the -showsdks option.

     xcodebuild -workspace MyWorkspace.xcworkspace -scheme MyScheme

              Builds the scheme MyScheme in the Xcode workspace
              MyWorkspace.xcworkspace.


     xcodebuild archive -workspace MyWorkspace.xcworkspace -scheme MyScheme

              Archives the scheme MyScheme in the Xcode workspace
              MyWorkspace.xcworkspace.

     xcodebuild build-for-testing -workspace MyWorkspace.xcworkspace -scheme
              MyScheme -destination generic/platform=iOS

              Build tests and associated targets in the scheme MyScheme in the
              Xcode workspace MyWorkspace.xcworkspace using the generic iOS
              device destination. The command also writes test parameters from
              the scheme to an xctestrun file in the built products directory.

     xcodebuild test-without-building -workspace MyWorkspace.xcworkspace
              -scheme MyScheme -destination 'platform=iOS
              Simulator,name=iPhone 5s' -destination 'platform=iOS,name=My
              iPad'

              Tests the scheme MyScheme in the Xcode workspace
              MyWorkspace.xcworkspace using both the iOS Simulator and the
              device named iPhone 5s for the latest version of iOS. The com-
              mand assumes the test bundles are in the build root (SYMROOT).
              (Note that the shell requires arguments to be quoted or other-
              wise escaped if they contain spaces.)

     xcodebuild test-without-building -xctestrun MyTestRun.xctestrun
              -destination 'platform=iOS Simulator,name=iPhone 5s'
              -destination 'platform=iOS,name=My iPad'

              Tests using both the iOS Simulator and the device named iPhone
              5s.  Test bundle paths and other test parameters are specified
              in MyTestRun.xctestrun.  The command requires project binaries
              and does not require project source code.


     xcodebuild test -workspace MyWorkspace.xcworkspace -scheme MyScheme
              -destination 'platform=macOS,arch=x86_64'

              Tests the scheme MyScheme in the Xcode workspace
              MyWorkspace.xcworkspace using the destination described as My
              Mac 64-bit in Xcode.

     xcodebuild -exportArchive -archivePath MyMobileApp.xcarchive -exportPath
              ExportDestination -exportOptionsPlist 'export.plist'

              Exports the archive MyMobileApp.xcarchive to the path
              ExportDestination using the options specified in export.plist.

     xcodebuild -exportLocalizations -project MyProject.xcodeproj
              -localizationPath MyDirectory -exportLanguage zh-hans
              -exportLanguage es-MX

              Exports two XLIFF files to MyDirectory from MyProject.xcodeproj
              containing development language strings and translations for
              Simplified Chinese and Mexican Spanish.

     xcodebuild -exportLocalizations -project MyProject.xcodeproj
              -localizationPath MyDirectory

              Export a single XLIFF file to MyDirectory from
              MyProject.xcodeproj containing only development language
              strings. (In this case, the -exportLanguage parameter has been
              excluded.)

     xcodebuild -importLocalizations -project MyProject.xcodeproj
              -localizationPath MyLocalizations.xliff


     xcodebuild -importLocalizations -project MyProject.xcodeproj
              -localizationPath MyLocalizations.xliff

              Imports localizations from MyLocalizations.xliff into
              MyProject.xcodeproj.  Translations with issues will be reported
              but not imported.

SEE ALSO
     ibtool(1), sysexits(3), xcode-select(1), xcrun(1), xed(1)

     Xcode Builds Settings Reference <https://developer.apple.com/
     documentation/DeveloperTools/Reference/XcodeBuildSettingRef/>

macOS                            June 20, 2016                           macOS

稍微概括下就是SYNOPSIS列舉了下常用的xcodebuild命令,隨后DESCRIPTION開始簡要介紹xcodebuild命令,并且提供了若干注意點:
1.If you have multiple projects in the this directory you will need to use -project to indicate which project should be built.By default, xcodebuild builds the first target listed in the project, with the default build configuration.當我們的工程文件包含多個項目時,需要使用-project來指明build的項目,如.xcodeproj.xcworkspace的區別。如果不指定則默認是-list下的第一個target,并且使用默認打包配置。
2.To build an Xcode workspace, you must pass both the -workspace and -scheme options to define the build. The parameters of the scheme will control which targets are built and how they are built, although you may pass other options to xcodebuild to override some parameters of the scheme.需要配置-scheme來控制那些targets會被build按照什么樣的方式打包
3.同時也有一些指令并不會打包,如These include -list, -showBuildSettings, -showsdks, -usage, and -version.
后面全是一大堆的指令介紹,就不一一解釋了,稍微看一眼,試一下就知道啥用處了。直到我看到了EXAMPLES,這正是我想要的。
??中有一個

 xcodebuild -exportArchive -archivePath MyMobileApp.xcarchive -exportPath  ExportDestination -exportOptionsPlist 'export.plist'
              Exports the archive MyMobileApp.xcarchive to the path
              ExportDestination using the options specified in export.plist.

前面使用PackageApplication時候出現的waining出現過的建議中的,-exportArchive的用法。
然后按照這個用法試著配了下,然而都不成功,幸好找到了CaryaLiu的博文,接下來就轉頭研究他提供的腳本的用法。

CaryaLiu的打包腳本

1.從CaryaLiu的github上下載到本地,將其中的autobuild文件保存到項目目錄下,與.xcworkspace文件統計。
2.cd到剛才移過去的工程目錄下的autobuild文件,輸入python autobuild.py -w ../xxx.xcworkspace -s xxx
3.桌面出現了以前打包會出現的帶日期的文件夾,內部一個ipa文件。
4.將這個ipa文件上傳到蒲公英,能夠正常安裝和使用。
#######遇到的問題
ImportError: No module named requests

使用 sudo easy_install -U requests 安裝就好了。
但是注意的是一定要掛VPN下載,不然下一下午也下不好~沒錯,我就傻乎乎掛著下了一下午,臨下班回過神,怎么還沒好。登了下VPN,呼呼幾分鐘就好了。。

仍然有的問題:說好的上傳到蒲公英呢。。居然失敗了。
再詳細的研究請移步原文:iOS自動打包并發布腳本.
PS:python好溜,加入學習計劃,嗯哼。

參考資料:
[iOS]從零開始寫個自動打包IPA腳本
【iOS打ipa包】:使用終端實現自動打包
iOS自動打包并發布腳本

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。
  • 序言:七十年代末,一起剝皮案震驚了整個濱河市,隨后出現的幾起案子,更是在濱河造成了極大的恐慌,老刑警劉巖,帶你破解...
    沈念sama閱讀 229,117評論 6 537
  • 序言:濱河連續發生了三起死亡事件,死亡現場離奇詭異,居然都是意外死亡,警方通過查閱死者的電腦和手機,發現死者居然都...
    沈念sama閱讀 98,860評論 3 423
  • 文/潘曉璐 我一進店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人,你說我怎么就攤上這事。” “怎么了?”我有些...
    開封第一講書人閱讀 177,128評論 0 381
  • 文/不壞的土叔 我叫張陵,是天一觀的道長。 經常有香客問我,道長,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 63,291評論 1 315
  • 正文 為了忘掉前任,我火速辦了婚禮,結果婚禮上,老公的妹妹穿的比我還像新娘。我一直安慰自己,他們只是感情好,可當我...
    茶點故事閱讀 72,025評論 6 410
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著,像睡著了一般。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發上,一...
    開封第一講書人閱讀 55,421評論 1 324
  • 那天,我揣著相機與錄音,去河邊找鬼。 笑死,一個胖子當著我的面吹牛,可吹牛的內容都是我干的。 我是一名探鬼主播,決...
    沈念sama閱讀 43,477評論 3 444
  • 文/蒼蘭香墨 我猛地睜開眼,長吁一口氣:“原來是場噩夢啊……” “哼!你這毒婦竟也來了?” 一聲冷哼從身側響起,我...
    開封第一講書人閱讀 42,642評論 0 289
  • 序言:老撾萬榮一對情侶失蹤,失蹤者是張志新(化名)和其女友劉穎,沒想到半個月后,有當地人在樹林里發現了一具尸體,經...
    沈念sama閱讀 49,177評論 1 335
  • 正文 獨居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內容為張勛視角 年9月15日...
    茶點故事閱讀 40,970評論 3 356
  • 正文 我和宋清朗相戀三年,在試婚紗的時候發現自己被綠了。 大學時的朋友給我發了我未婚夫和他白月光在一起吃飯的照片。...
    茶點故事閱讀 43,157評論 1 371
  • 序言:一個原本活蹦亂跳的男人離奇死亡,死狀恐怖,靈堂內的尸體忽然破棺而出,到底是詐尸還是另有隱情,我是刑警寧澤,帶...
    沈念sama閱讀 38,717評論 5 362
  • 正文 年R本政府宣布,位于F島的核電站,受9級特大地震影響,放射性物質發生泄漏。R本人自食惡果不足惜,卻給世界環境...
    茶點故事閱讀 44,410評論 3 347
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧,春花似錦、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 34,821評論 0 28
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至,卻和暖如春,著一層夾襖步出監牢的瞬間,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 36,053評論 1 289
  • 我被黑心中介騙來泰國打工, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留,地道東北人。 一個月前我還...
    沈念sama閱讀 51,896評論 3 395
  • 正文 我出身青樓,卻偏偏與公主長得像,于是被迫代替她去往敵國和親。 傳聞我的和親對象是個殘疾皇子,可洞房花燭夜當晚...
    茶點故事閱讀 48,157評論 2 375

推薦閱讀更多精彩內容