導航:首頁 > 程序命令 > xcode命令行工具

xcode命令行工具

發布時間:2022-08-18 17:58:30

『壹』 xcode怎麼打包ipa

如果你想自動打包 ipa 需要蘋果開發者賬號,XCode 為自動申請證書然後打包。

如果你沒有蘋果開發者賬號,那就只能使用命令行打包了,而且打出來的包沒有簽名。

命令行工具是: xcodebuild

可以參見這個例子:網頁鏈接

『貳』 如何安裝命令行開發工具Xcode

『叄』 xcode select怎麼用

如果你的電腦中有幾個xcode版本,比如一個xcode5.1.1,一個xcode6-beta, 當你打開工程的時候,通常會有一個默認配置,或者使用terminal命令行操作,需要選擇使用xcode的不同版本,怎麼更改這個配置呢? 請看下文:
It』s not uncommon developers to have multiple versions of Xcode installed. For example, I typically have the latest beta as well as the most current proction release installed.
However, there are times when you may want various tools, such as xcodebuild, to point to a specific Xcode folder. To faciliate this, you can use xcode-select. A common use case is if you use scripts and/or makefiles to build your projects.
Once you set the Xcode folder, xcodebuild will be invoked from the folder you specified.

The command line options are below:
xcode-select [-help]
xcode-select [-switch xcode_folder_path]
xcode-select [-print-path]
xcode-select [-version]

Here is how to print the current Xcode path:
1
2

~$ xcode-select --print-path
/Developer/Applications/Xcode.app

Line number 2 shows the current version of Xcode that is 『active.』 If you are accessing xcodebuild or other related tools from a script, –print-path is the preferred means to determine the current Xcode location.
Use the -switch option to change to another version of Xcode on your system:
$ sudo xcode-select -switch /Users/JOHN/Downloads/Xcode45-DP3.app

This changes to the Xcode 4.5, Developer Preview 3 on my system. Note that root access is required to set the Xcode location, thus I have used sudo to execute the command as root.
Printing the path now looks as follows:
1
2

~$ xcode-select --print-path
/Users/JOHN/Downloads/Xcode45-DP3.app/Contents/Developer

To switch back to Xcode installed in the /Applications directory:
$ sudo xcode-select -switch /Applications/Xcode.app/

You can read more about xcode-select by view the man page from a terminal:
~$man xcode-select

『肆』 mac系統的command_line_tools是做什麼用的和Xcode什麼關系

可以用它來建項目,可以寫c語言程序,或者建立文件夾,都是可以的。

『伍』 xcode使用方法

xcode使用方法:(以xcode5為例)


1,下載安裝好xcode5後,就可以開始ios開發之旅了。首先打開xcode。選擇新建一個xcode項目。

『陸』 使用mac進行ios幾種命令行打包方式

自動打包的方式有如下幾種:
一、使用xcodebuild進行打包
參考apple文檔:https://developer.apple.com/library/prerelease/mac/documentation/Darwin/Reference/ManPages/man1/xcodebuild.1.html
xcodebuild -project "${TARGET}.xcodeproj" -target ${TARGET} CODE_SIGN_IDENTITY="${IDENTITY}" clean //將project clean下

xcodebuild -workspace MyWorkspace.xcworkspace -scheme MyScheme archive //進行archive,生成xcarchive文件
xcodebuild -exportArchive -exportFormat IPA -archivePath MyMobileApp.xcarchive -exportPath MyMobileApp.ipa -exportProvisioningProfile 'MyMobileApp Distribution Profile'
確實是可以生成.ipa,但是可能會導致不能安裝,https://developer.apple.com/library/prerelease/mac/documentation/Darwin/Reference/ManPages/man1/xcodebuild.1.html , 鏈接是apple的官方文檔,文檔大概的意思將 xcarchive文件作為.ipa方式進行導出, 為什麼不能在ios設備上安裝?
二、原生xcodebuild、xcrun進行打包,需要詳細了解,可以看下這個鏈接 http://www.jianshu.com/p/1229476fbce4
具體打包指令和第一種方法區別不大,不同代碼如下:
xcodebuild -scheme Zxh -configuration ${buildConfiguration} clean //對代碼進行clean
xcodebuild -project Zxh.xcodeproj -scheme Zxh -configuration ${buildConfiguration} -destination generic/platform=ios archive -archivePath ${buildPath} //進行build,相當於在xcode裡面進行command+b,生成.app文件
#xcrun -sdk iphoneos PackageApplication -v build/Release-iphoneos/Zxh.app -o ${ipaName}.ipa --sign "iPhone Distribution:(打包證書)" //根據.app文件生成的ipa文件導出到指定目錄
三、xctool進行自動打包

參考網頁地址:http://www.tuicool.com/articles/uIZRZjy
1、確保安裝了xctool

沒有安裝xctool,可以用brew安裝,沒有安裝brew的,可以通過搜索安裝brew,然後執行如下操作安裝xctool

安裝命令:sudo brew install xctool
介紹下xctool命令:
xctool 是FaceBook開源的一個命令行工具,用來替代蘋果的xcodebuild工具。
先附上打包用的參考代碼,如下:
#
cd AutoProject //進入項目目錄

#
buildDay=$(date +%Y%m%d) //獲取當前日期
buildTime=$(date +%Y%m%d%H%M) //獲取當前時間
profile=」xxxx」 //設置打包配置文件
#
buildConfiguration=」QA」 //build時用的證書
buildPath=」../ArchiveProction/QA/${buildDay}/Auto_QA_${buildTime}.xcarchive」 //build後歸檔的文件目錄
ipaName=」../ipa/QA/${buildDay}/Auto_QA_${buildTime}.ipa」 //打好包放置位置
#
xctool -scheme AutoProject -configuration ${buildConfiguration} clean //clean下工程
xctool -scheme AutoProject -configuration ${buildConfiguration} archive -archivePath ${buildPath} //對項目進行Archive, 將xcarchive文件導出到指定目錄
xcodebuild -exportArchive -exportFormat IPA -archivePath ${buildPath} -exportPath ${ipaName} - exportProvisioningProfile 「$profile」 //生成的ipa文件導出到指定目錄, 此處依然使用的是xcodebuild進行打包, 待優化

閱讀全文

與xcode命令行工具相關的資料

熱點內容
彎村紅羊電影 瀏覽:157
我和我的家教老師韓國 瀏覽:102
日本經典高分電影 瀏覽:627
動物真人版電影鳳凰定製 瀏覽:360
海客雲伺服器一個月怎麼算的 瀏覽:161
黑道小說主角外號瘋子 瀏覽:309
書包cc網電子書txt免費下載 瀏覽:354
帶一點黃的小說 瀏覽:257
法國倫理電影小僕人 瀏覽:187
印度搶打火機的電影叫什麼 瀏覽:291
求在線觀看資源2020年 瀏覽:946
聚優電影可以在哪些影院使用 瀏覽:124
阿里雲伺服器怎麼安裝bt面板 瀏覽:630
霍爾瓦特大街小說 瀏覽:857
可以看的網址大全 瀏覽:416
一個名叫尼克和保姆的電影 瀏覽:613
電影里有戒尺的 瀏覽:845
徐英演的哪些大尺度電影 瀏覽:412
鬼片英文版 瀏覽:600
《前度2》完整未刪減 瀏覽:851