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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
toshi0383
September 17, 2017
Programming
1.7k
0
Share
xcconfig pitfalls
presented at iOSDC Japan 2017
toshi0383
September 17, 2017
More Decks by toshi0383
See All by toshi0383
CoreDataはじめました
toshi0383
0
180
Swiftコードバトル必勝法
toshi0383
1
330
Sheets API使ってみた
toshi0383
2
390
visionOSについてGlobeeが取り組んでいること
toshi0383
0
590
agile20150512-150512055145-lva1-app6892.pdf
toshi0383
0
250
たのしいAirPlay
toshi0383
1
770
Profiling using Signpost
toshi0383
2
1k
AVPlayer周りの設計tips
toshi0383
6
910
cmdshelf::from("Swift")
toshi0383
3
920
Other Decks in Programming
See All in Programming
Nuxt Server Components
wattanx
0
270
Feature Toggle は捨てやすく使おう
gennei
0
580
JAWS-UG横浜 #100 祝・第100回スペシャルAWS は VPC レスの時代へ
maroon1st
0
110
ふりがな Deep Dive try! Swift Tokyo 2026
watura
0
200
Vibe NLP for Applied NLP
inesmontani
PRO
0
390
mruby on C#: From VM Implementation to Game (RubyKaigi 2026)Scripting
hadashia
1
150
The Monolith Strikes Back: Why AI Agents ❤️ Rails Monoliths
serradura
0
320
Coding as Prompting Since 2025
ragingwind
0
820
TiDBのアーキテクチャから学ぶ分散システム入門 〜MySQL互換のNewSQLは何を解決するのか〜 / tidb-architecture-study
dznbk
1
170
PHPのバージョンアップ時にも役立ったAST(2026年版)
matsuo_atsushi
0
310
How Swift's Type System Guides AI Agents
koher
0
240
10 Tips of AWS ~Gen AI on AWS~
licux
5
340
Featured
See All Featured
Build your cross-platform service in a week with App Engine
jlugia
234
18k
What's in a price? How to price your products and services
michaelherold
247
13k
Documentation Writing (for coders)
carmenintech
77
5.3k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
400
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
510
A designer walks into a library…
pauljervisheath
211
24k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.5k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
9.9k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
260
We Have a Design System, Now What?
morganepeng
55
8.1k
Accessibility Awareness
sabderemane
0
99
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