我一直在研究iOS應用程序的構建過程。我創建了一個「單視圖應用程序」項目,並構建在Xcode 8.2.1中。 當我在查看構建報告時,我注意到Xcode使用clang編譯並鏈接.m文件,然後使用ibtool編譯和鏈接storyboard文件。我想知道在編譯和鏈接過程中ibtool實際做了什麼。在以下編譯命令後,在/Users/Kazu/Library/Developer/Xcode/DerivedData/ObjCHelloWorld-guewhpmwckompbfvsbhizkifcadg/Build/Intermediates/ObjCHelloWorld.build/Debug-iphonesimulator/ObjCHelloWorld.build/Base.lproj/
目錄中創建.storyboardc文件,稍後將在「Link Storyboards」階段中使用該目錄。 .storyboardc
文件是一系列包含Info.plist文件的二進制文件。ibtool在編譯和鏈接故事板階段以及鏈接故事板的結果如何與可執行文件一起工作時做了什麼?
ObjCHelloWorld/Base.lproj/LaunchScreen.storyboard
cd /Users/Kazu/Dropbox/ObjCHelloWorld
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
export XCODE_DEVELOPER_USR_PATH=/Applications/Xcode.app/Contents/Developer/usr/bin/..
/Applications/Xcode.app/Contents/Developer/usr/bin/ibtool --errors --warnings --notices --module ObjCHelloWorld --output-partial-info-plist /Users/Kazu/Library/Developer/Xcode/DerivedData/ObjCHelloWorld-guewhpmwckompbfvsbhizkifcadg/Build/Intermediates/ObjCHelloWorld.build/Debug-iphonesimulator/ObjCHelloWorld.build/LaunchScreen-SBPartialInfo.plist --auto-activate-custom-fonts --target-device iphone --target-device ipad --minimum-deployment-target 10.2 --output-format human-readable-text --compilation-directory /Users/Kazu/Library/Developer/Xcode/DerivedData/ObjCHelloWorld-guewhpmwckompbfvsbhizkifcadg/Build/Intermediates/ObjCHelloWorld.build/Debug-iphonesimulator/ObjCHelloWorld.build/Base.lproj /Users/Kazu/Dropbox/ObjCHelloWorld/ObjCHelloWorld/Base.lproj/LaunchScreen.storyboard
在鏈接階段,執行下面的命令,我不知道ibtool在做什麼。我只能說在編譯階段生成的文件是storyboardc
。
LinkStoryboards
cd /Users/Kazu/Dropbox/ObjCHelloWorld
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
export XCODE_DEVELOPER_USR_PATH=/Applications/Xcode.app/Contents/Developer/usr/bin/..
/Applications/Xcode.app/Contents/Developer/usr/bin/ibtool --errors --warnings --notices --module ObjCHelloWorld --target-device iphone --target-device ipad --minimum-deployment-target 10.2 --output-format human-readable-text --link /Users/Kazu/Library/Developer/Xcode/DerivedData/ObjCHelloWorld-guewhpmwckompbfvsbhizkifcadg/Build/Products/Debug-iphonesimulator/ObjCHelloWorld.app /Users/Kazu/Library/Developer/Xcode/DerivedData/ObjCHelloWorld-guewhpmwckompbfvsbhizkifcadg/Build/Intermediates/ObjCHelloWorld.build/Debug-iphonesimulator/ObjCHelloWorld.build/Base.lproj/LaunchScreen.storyboardc /Users/Kazu/Library/Developer/Xcode/DerivedData/ObjCHelloWorld-guewhpmwckompbfvsbhizkifcadg/Build/Intermediates/ObjCHelloWorld.build/Debug-iphonesimulator/ObjCHelloWorld.build/Base.lproj/Main.storyboardc
我的問題是,什麼是ibtool在鏈接階段做什麼?是否有任何產品或鏈接到由clang完成的前一個鏈接階段創建的可執行文件?