Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
xcconfig pitfalls
Search
toshi0383
September 17, 2017
Programming
1.8k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
xcconfig pitfalls
presented at iOSDC Japan 2017
toshi0383
September 17, 2017
More Decks by toshi0383
See All by toshi0383
CoreDataはじめました
toshi0383
0
190
Swiftコードバトル必勝法
toshi0383
1
360
Sheets API使ってみた
toshi0383
2
420
visionOSについてGlobeeが取り組んでいること
toshi0383
0
610
agile20150512-150512055145-lva1-app6892.pdf
toshi0383
0
260
たのしいAirPlay
toshi0383
1
800
Profiling using Signpost
toshi0383
2
1.1k
AVPlayer周りの設計tips
toshi0383
6
930
cmdshelf::from("Swift")
toshi0383
3
940
Other Decks in Programming
See All in Programming
実装をデザインガイドラインに追従させるための取り組み / 260731-dip-mosh-design-system
dachi023
0
450
生成AI導入の「期待外れ」を乗り越える ー 開発フロー改革が目指す、真の組織変革
starfish719
0
4.4k
いまどきの Codex で開発する visionOS アプリの開発スタイルについて
karad
0
140
自動化したのに回らないテスト運用の壁ーAI時代の品質責任と生産性
mfunaki
0
130
PHP初心者セッション2026 〜生成AIでは見えない裏側を知る:今だからLAMPを通して仕組みを学ぶ〜
kashioka
0
930
GDG Korea Android: 2026 I/O Extended ~ What's new in Android development tools
pluu
0
220
PHP Application における Kubernetes 内 gRPC 通信
ganchiku
0
590
ソフトウェア設計に溶けるインフラ ― AWS CDK のインフラ認識論
konokenj
3
790
ルールを書いて終わらせないハーネスエンジニアリング
yug1224
4
1.9k
関東Kaggler会_NVIDIA_Nemotron_コンペ_振り返り
rick_ds
0
580
変わらないものが、変わるものを決める — 意図駆動開発 × イベントソーシング × イミュータブル | What Doesn't Change Decides What Can — IDD × Event Sourcing × Immutability
tomohisa
0
1.7k
テーブルをDELETEした
yuzneri
0
140
Featured
See All Featured
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
230
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
1.8k
Building Adaptive Systems
keathley
44
3.2k
So, you think you're a good person
axbom
PRO
2
2.1k
The SEO identity crisis: Don't let AI make you average
varn
0
530
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
6.1k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
490
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.1k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
Art, The Web, and Tiny UX
lynnandtonic
304
22k
Everyday Curiosity
cassininazir
0
280
Transcript
xcconfig pitfalls (LT) iOSDC 2017 Sep 17, 2017 Toshihiro Suzuki
© Toshihiro Suzuki 2017 1
whoami — ླ ढ़༟ (@toshi0383) Toshihiro Suzuki — iOS/tvOS Dev
at AbemaTV — Father (5 month) — F1, GT SPORT © Toshihiro Suzuki 2017 2
tools and apps https://toshi0383.github.io/LGTM © Toshihiro Suzuki 2017 3
Agenda — What's xcconfig and Why would you use it?
— Common Pitfails © Toshihiro Suzuki 2017 4
What's xcconfig? where you put your build se!ings © Toshihiro
Suzuki 2017 5
How it looks on Xcode © Toshihiro Suzuki 2017 6
How it looks inside xcconfig © Toshihiro Suzuki 2017 7
Why? — Easier to review in Pull requests — Refactor
using #include — Reusable © Toshihiro Suzuki 2017 8
Recommended way to extract — Extract using toshi0383/xcconfig-extractor — Validate
using xcodebuild -showBuildSettings © Toshihiro Suzuki 2017 9
Let's Do it ! CONFIGURATION =-configuration Debug WORKSPACE =-workspace iOSSingleViewApp.xcworkspace
SCHEME =-scheme iOSSingleViewApp OPTIONS=$(CONFIGURATION) $(WORKSPACE) $(SCHEME) xcodebuild -showBuildSettings $(OPTIONS) > before xcconfig-extractor --no-trim-duplicates *.xcodeproj Config/xcconfigs xcodebuild -showBuildSettings $(OPTIONS) > after diff before after © Toshihiro Suzuki 2017 10
Sample App © Toshihiro Suzuki 2017 11
Result © Toshihiro Suzuki 2017 12
$(inherited) is ignored ! — ./Config/xcconfigs/iOSSingleViewApp-Debug.xcconfig FRAMEWORK_SEARCH_PATHS = $(inherited) $
(PROJECT_DIR)/Carthage/Build/iOS — ./Pods/Target Support Files/Pods-iOSSingleViewApp/ Pods-iOSSingleViewApp.debug.xcconfig FRAMEWORK_SEARCH_PATHS = $(inherited) "$ {PODS_ROOT}/TwitterCore/iOS" "${PODS_ROOT}/ TwitterKit/iOS" © Toshihiro Suzuki 2017 13
On CI.. e.g. fastlane's increment_version_number depends on agvtool © Toshihiro
Suzuki 2017 14
Migration failed! — Unwanted FRAMEWORK_SEACH_PATHS diff ! — Failed to
increment version using agvtool © Toshihiro Suzuki 2017 15
How $(inherited) works? — Inherites from parent LEVEL's value in
Build Settings — Does NOT work for #include © Toshihiro Suzuki 2017 16
App's FRAMEWORK_SEACH_PATHS overwri!en CocoaPods's © Toshihiro Suzuki 2017 17
Fix ✅ Set FRAMEWORK_SEACH_PATHS in rootObject's xcconfig © Toshihiro Suzuki
2017 18
Why agvtool failed to update version? — Answer: agvtool is
not clever enough — It does NOT search for INFOPLIST_FILE value in xcconfig. © Toshihiro Suzuki 2017 19
Workaround #1 Restore INFOPLIST_FILE in Xcode's buildSettings section © Toshihiro
Suzuki 2017 20
Workaround #2 Use /usr/libexec/PlistBuddy instead of agvtool e.g. APP_VERSION=$(git describe
--tags --abbrev=0) BUILD_VERSION=$BITRISE_BUILD_NUMBER /usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString ${APP_VERSION}" AbemaTV/Info.plist /usr/libexec/PlistBuddy -c "Set :CFBundleVersion ${BUILD_VERSION}" AbemaTV/Info.plist © Toshihiro Suzuki 2017 21
Summary © Toshihiro Suzuki 2017 22
$(inherited) — works btw LEVELs but not for #include INFOPLIST_FILE
— agvtool compatibility © Toshihiro Suzuki 2017 23
xcconfig-extractor Options: --no-trim-duplicates [default: false] --no-edit-pbxproj [default: false] --include-existing [default:
true] --no-set-configurations [default: false] © Toshihiro Suzuki 2017 24
End © Toshihiro Suzuki 2017 25
Toshihiro Suzuki Feel free to reach out! Twitter: @toshi0383 GitHub:
@toshi0383 Qiita: @toshi0383 Email:
[email protected]
© Toshihiro Suzuki 2017 26