如题所述
xcodebuild
è¹æå®æ¹æä¾ççXcode项ç®åå·¥ä½ç©ºé´ï¼workspaceï¼ç¼è¯å·¥å ·ï¼ä¹å°±æ¯xcodeèªå¸¦çéå¾å½¢åå½ä»¤è¡ç¼è¯å·¥å ·ã详ç»ç使ç¨æ¹æ³å¨å½ä»¤è¡æ§è¡ï¼
man xcodebuild
ç³»ç»ä¼åè¯ä½ ææçç¨æ³ï¼è¿éå°±ä¸è¯¦ç»ä»ç»äºã
xcpretty
xcpretty is a fast and flexible formatter for xcodebuild
å ¶å®å°±æ¯ç¨æ¥æ ¼å¼åï¼ç¾åï¼xcodebuildå½ä»¤è¡å·¥å ·è¾åºæ¥å¿çä¸ä¸ªå°å·¥å ·ï¼æ们æ°å»ºä¸ä¸ªSingle Viewç项ç®xcodebuilddemoï¼ç¶åå¨å½ä»¤è¡æ§è¡ï¼
xcodebuild
è¾åºæ¥å¿å¦ä¸å¾æ示ï¼
xcodebuild_snapshot.png
å个åâæ¨ä¸å¿ç¹âã
OK, xcpretty表ç°ä¸ä¸å§ï¼æ§è¡å¦ä¸å½ä»¤ï¼
xcodebuild | xcpretty
è¾åºæ¥å¿å¦ä¸å¾æ示ï¼
xcpretty_snapshot.png
OKï¼ä¸ç¨è¿å¤è§£éäºï¼ä¸è¿æ§è¡ä¸é¢çå½ä»¤æ¶å æ§è¡ä¸é¢çå½ä»¤å®è£ xcpretty:
gem install xcpretty
æ´å¤ä½¿ç¨æ¹æ³è§é¡¹ç®é¦é¡µï¼https://github.com/supermarin/xcpretty
xctool
xctoolæ¯facebookæ¨åºçç¨äºæ¿æ¢xcodebuildçæ´æäºæµè¯iosåmacåºç¨ç¨åºçå½ä»¤è¡å·¥å ·ï¼ç¹å«éç¨äºios appçæç»éæã
注æï¼åå¼å§xctoolä¸ä» ç¨äºååå æµè¯ï¼å æ¬ç¼è¯ãæå çåè½ï¼ä½ç°å¨ç¼è¯ãæå çåè½è¢«æ¾å°facebookçå¦ä¸ä¸ªé¡¹ç®xcbuildä¸äºï¼æ以xctoolç®å主è¦æ¯ç¨äºåå æµè¯ã
xctoolçå®æ¹ç½åï¼https://github.com/facebook/xctool
å®è£ ï¼
brew install xctool
å¦ææ¨çmacæºå¨ä¸è¿brewé½æ²¡è£ ï¼é£ä½ çè½ä¼äºï¼èªå·±å»ç 究å§ã
使ç¨ï¼
xctool -project xcodebuilddemo.xcodeproj -scheme xcodebuilddemo test -test-sdk iphonesimulator9.3
æ´è¯¦ç»ç使ç¨æ¹æ³èªå·±å°å®æ¹ç½ç«ç 究å§ãå¯ä»¥æå®åªæµè¯æ个ç¨ä¾ï¼æ个æ¹æ³å¦ã
xcbuild
xcbuildæ¯ä¸ä¸ªå ¼å®¹Xcodeçç¼è¯å·¥å ·ï¼å®è½ä½¿ç¼è¯æ´å¿«å¿«éï¼æ´å好çç¼è¯è¿ç¨æ¥å¿ï¼å¯ä»¥è¿è¡å¨å¤ä¸ªå¹³å°ï¼ä¸»è¦æOS XåLinuxï¼ã
详ç»ç使ç¨æ¹æ³å¯è§å®æ¹ç½ç«ï¼https://github.com/facebook/xcbuild
ç®å该项ç®è¿æ¯è¾æ°ï¼åºè¯¥æ¯åä»xctoolä¸å¥ç¦»åºæ¥ï¼åªè½ä»æºç å®è£ ã
èªå·±å»è¯ä¸è¯å§ã
è¹æå®æ¹æä¾ççXcode项ç®åå·¥ä½ç©ºé´ï¼workspaceï¼ç¼è¯å·¥å ·ï¼ä¹å°±æ¯xcodeèªå¸¦çéå¾å½¢åå½ä»¤è¡ç¼è¯å·¥å ·ã详ç»ç使ç¨æ¹æ³å¨å½ä»¤è¡æ§è¡ï¼
man xcodebuild
ç³»ç»ä¼åè¯ä½ ææçç¨æ³ï¼è¿éå°±ä¸è¯¦ç»ä»ç»äºã
xcpretty
xcpretty is a fast and flexible formatter for xcodebuild
å ¶å®å°±æ¯ç¨æ¥æ ¼å¼åï¼ç¾åï¼xcodebuildå½ä»¤è¡å·¥å ·è¾åºæ¥å¿çä¸ä¸ªå°å·¥å ·ï¼æ们æ°å»ºä¸ä¸ªSingle Viewç项ç®xcodebuilddemoï¼ç¶åå¨å½ä»¤è¡æ§è¡ï¼
xcodebuild
è¾åºæ¥å¿å¦ä¸å¾æ示ï¼
xcodebuild_snapshot.png
å个åâæ¨ä¸å¿ç¹âã
OK, xcpretty表ç°ä¸ä¸å§ï¼æ§è¡å¦ä¸å½ä»¤ï¼
xcodebuild | xcpretty
è¾åºæ¥å¿å¦ä¸å¾æ示ï¼
xcpretty_snapshot.png
OKï¼ä¸ç¨è¿å¤è§£éäºï¼ä¸è¿æ§è¡ä¸é¢çå½ä»¤æ¶å æ§è¡ä¸é¢çå½ä»¤å®è£ xcpretty:
gem install xcpretty
æ´å¤ä½¿ç¨æ¹æ³è§é¡¹ç®é¦é¡µï¼https://github.com/supermarin/xcpretty
xctool
xctoolæ¯facebookæ¨åºçç¨äºæ¿æ¢xcodebuildçæ´æäºæµè¯iosåmacåºç¨ç¨åºçå½ä»¤è¡å·¥å ·ï¼ç¹å«éç¨äºios appçæç»éæã
注æï¼åå¼å§xctoolä¸ä» ç¨äºååå æµè¯ï¼å æ¬ç¼è¯ãæå çåè½ï¼ä½ç°å¨ç¼è¯ãæå çåè½è¢«æ¾å°facebookçå¦ä¸ä¸ªé¡¹ç®xcbuildä¸äºï¼æ以xctoolç®å主è¦æ¯ç¨äºåå æµè¯ã
xctoolçå®æ¹ç½åï¼https://github.com/facebook/xctool
å®è£ ï¼
brew install xctool
å¦ææ¨çmacæºå¨ä¸è¿brewé½æ²¡è£ ï¼é£ä½ çè½ä¼äºï¼èªå·±å»ç 究å§ã
使ç¨ï¼
xctool -project xcodebuilddemo.xcodeproj -scheme xcodebuilddemo test -test-sdk iphonesimulator9.3
æ´è¯¦ç»ç使ç¨æ¹æ³èªå·±å°å®æ¹ç½ç«ç 究å§ãå¯ä»¥æå®åªæµè¯æ个ç¨ä¾ï¼æ个æ¹æ³å¦ã
xcbuild
xcbuildæ¯ä¸ä¸ªå ¼å®¹Xcodeçç¼è¯å·¥å ·ï¼å®è½ä½¿ç¼è¯æ´å¿«å¿«éï¼æ´å好çç¼è¯è¿ç¨æ¥å¿ï¼å¯ä»¥è¿è¡å¨å¤ä¸ªå¹³å°ï¼ä¸»è¦æOS XåLinuxï¼ã
详ç»ç使ç¨æ¹æ³å¯è§å®æ¹ç½ç«ï¼https://github.com/facebook/xcbuild
ç®å该项ç®è¿æ¯è¾æ°ï¼åºè¯¥æ¯åä»xctoolä¸å¥ç¦»åºæ¥ï¼åªè½ä»æºç å®è£ ã
èªå·±å»è¯ä¸è¯å§ã
温馨提示:答案为网友推荐,仅供参考