Xcode的build setting
Xcode裡面有很多很神奇的編譯設定,特別是Xcode7以後又有很多的變化,這裡做一個歸納
- Enable Testablity
這個選項的意思是,當你需要用到UI測試的時候,有一個關鍵字@testable
,用於自動引入要測試的類,譬如
@testable import TestViewController
建議在debug狀態下開啟該選項
參考連結
UI Testing in Xcode
How to Implement UI Testing in an Existing iOS App
Xcode:為你的專案整合單元測試(unit tests)時記得避開這些坑
- Weak References in Manual Retain Release
如果你升級了xcode7.3以後的版本,有可能會在編譯時報錯,主要針對的是MRC檔案混編的場景。在我們的專案中也有遇到類似的問題,譬如如下程式碼
+ (id)getNewValueFromObject:(__weak id)object oldValue:(__weak id)oldValue property:(__weak MJProperty *)property;
在MRC檔案混編的時候會出錯,解決辦法是將這個編譯項設定為YES就好了。簡單來說就是在MRC下也能夠支援__weak
的runtime特性了。
參考連結
xcode7.3編譯問題
<a href="https://segmentfault.com/q/1010000004670789">iOS9.3 __weak reference</a>
<a href="http://stackoverflow.com/questions/36147625/xcode-7-3-cannot-create-weak-reference-in-file-using-manual-reference-counting">Xcode 7.3 cannot create __weak reference in file using manual reference counting</a>
Xcode 7.3b4, non-arc, cannot create __weak reference
Xcode 7.3 Cannot create __weak reference in file using manual reference counting
- Enable On Demand Resources
這是IOS9的新特性,跟App減少包體積有關。不過實際情況不太樂觀,簡單來說他的實現方式是,App先標記好哪些圖片是需要按需載入的,然後提交全量包到AppStore。當使用者下載App的時候,將不會下載標記的圖片,等到App需要後載入資源的時候再下載。資原始檔的託管是在AppStore伺服器上。所以如果你想要使用該技術的話,要先做以下步驟
- 將這個設定項設定為YES
- 標記資源
- 使用指定的api按照tagid下載資源
參考連結
關於iOS9的APP瘦身
按需載入資源開發指南
On-Demand Resources Guide
Deployment Postprocessing
對ipa進行包體積優化的時候,一般需要去除無用的符號資訊,但是根據蘋果的文件,要使得Strip Style生效,還需要對這個編譯選項設定為YES才有用
參考連結
Symbolification: Shipping Symbols
Build Setting Reference
iOS可執行檔案瘦身方法Defines Module
當需要OC和Swift混編的時候,需要將這個選項設定為YES
在一個專案中同時使用Swift和Objective-C程式碼混合程式設計的方法
Importing Code from Within the Same Framework TargetForce Package Info Generation
Inline Methods Hidden
Symbols Hidden By Default
Enable Modules(C and Objective-C)
Enable Strict Checking of objc_msgSend Calls
Compress PNG Files
GCC_THUMB_SUPPORT
Skip Install
相關文章
- Xcode上Version和BuildXCodeUI
- Not enough space to build proposed filesystem while setting up superblockUIWhileBloC
- Xcode build慢的兩個解決方法XCodeUI
- 踩坑Xcode 10之New Build SystemXCodeUI
- xcode9 pod update後友盟build不過XCodeUI
- Xcode 11.3.1 + iOS 13.3.1 Build WDA 成功,但 Testing 時失敗XCodeiOSUI
- sendmail settingAI
- SMART Goal SettingGo
- 使用Xcode External Build System實現Rust 專案 Capture GPU Frame 線上除錯 MetalXCodeUIRustAPTGPU除錯
- Procedure for Setting Partner FunctionsFunction
- 阿里雲setting阿里
- 應用設定Setting的實現
- ASM Setting Larger AU SizesASM
- SAPGUI for Java Connect settingGUIJava
- Setting the Database Time Zone (80)Database
- “setting.xml” has syntax errorsXMLError
- 【Basis】HANA Database SR Basis SettingDatabase
- configure Django db settingDjango
- Docker proxy setting ubuntu 14.04DockerUbuntu
- Mac address setting For RedhatMacRedhat
- Xcode的Refactor使用XCode
- 忽略Xcode的警告XCode
- XcodeXCode
- Setting file visibility under MacOSXMac
- Setting REMOTE_LOGIN_PASSWORDFILE (45)REM
- xcode 外掛之KSImageNamed-XcodeXCode
- Xcode-lldb的使用XCodeLLDB
- Build CookbookUI
- NDK buildUI
- 使用Xcode External Build System實現Rust 專案 Capture GPU Frame 線上除錯 Metal 2018.12.18XCodeUIRustAPTGPU除錯
- xcode編譯時,有第三方庫時,編譯設定build active architecture only問題XCode編譯UI
- build.xml的問題UIXML
- PostgreSQL DBA(156) - pgAdmin(Rollback setting)SQL
- git (v2.18.0) error setting certificateGitError
- Requested setting INSTALLED_APPSAPP
- python中setting.py詳解Python
- Setting the Buffer Cache Initialization Parameters (108)
- Xcode分析XCode