標籤:
簡介:用agvtool如何來自動更新版本號碼和bulid version agvtool是一個命令列工具,允許你自動遞增到下一個最高的數量或具體的數字這些數字。本文檔提供了更新您的構建和版本號碼使用agvtool一步一步的指示。“Xcode”和“命令列”部分顯示是在Xcode中分別執行的步驟和命令列。 Important: When your app includes multiple targets, agvtool will set the version numbers of all your targets to the same number.
Xcode:
你必須完成你的在Xcode項目中的設定步驟。
導航到您的目標的產生設定窗格,然後為您的組建組態進行更新,如下所示:
1.修改Xcode的預設設定
預設情況下,在不使用任何版本控制系統。設定版本系統蘋果通用確保Xcode將包括在你的項目中產生的所有agvtool版本資訊。
圖1:設定當前項目的版本和版本控制系統的構建設定
2.設定你的版本號碼和bulid版本號碼 Set up your version and build numbers.
這個需要你手動添加幾個項,來圖看看
agvtool查詢應用程式的Info.plist得到你的版本和bulid版本號碼。它更新他們,如果他們存在,不做任何事,
否則。確保 CFBundleVersion (Bundle version)和CFBundleShortVersionString (Bundle versions string, short)的key在你的Info.plist中
2所示。 info.plist顯示
3.接下來是命令列操作,來更新版本號碼
退出Xcode,然後導航到包含項目的目錄,運行下列命令在終端應用agvtool屬性工作。
3.1 開啟終端 ,cd 工程直接路徑 例如工程名為xxx 則cd /Users/itdept/Desktop/practice/xxx 3.2 更新版本號碼 到2.0 則輸入命令:$xcrun agvtool new-marketing-version 2.0 4.更新Build Number 4.1 自動增加你的Build Number 執行的命令:$xcrun agvtool next-version -all 4.2 給你的應用程式設定一個Build number,執行的命令是 $xcrun agvtool new-version -all 2.6.95.查看Version Numbers 5.1查看當前的Version Number 執行:$xcrun agvtool what-marketing-version 5.2 查看當前的Build Number 執行:$xcrun agvtool what-version
關於XCode 的agvtool命令列