Xcode 9 Release Notes
關(guān)于Xcode
Accessing Additional Developer Tools
其他開發(fā)工具入口
To launch additional developer tools, such as Instruments and FileMerge, launch Xcode-beta and select Xcode > Open Developer Tool. You can keep these additional tools in your Dock for direct access when Xcode isn’t running.
訪問其他開發(fā)工具,例如Instruments和FileMerge,打開Xcode,選擇Xcode > Open Developer Tool。可以將其他工具保留在Dock欄,就可以不打開Xcode時直接訪問這些工具。
More Develop Tools
Technical Support and Learning Resources
技術(shù)支持和學(xué)習(xí)資源
Apple provides the following web resources to support your development with Xcode:
蘋果提供以下Xcode開發(fā)支持:
- Apple Developer Forums. Participate in discussions about developing for Apple platforms and using developer tools.
蘋果開發(fā)論壇。參與蘋果開發(fā)平臺和開發(fā)工具使用的討論。- Bug Reporter. Report issues, enhancement requests, and feedback to Apple. Provide detailed information, including the system and developer tools version information, and any relevant crash logs or console messages.
提交Bug。向蘋果報告問題、改進建議、反饋。提供詳細(xì)信息,包括系統(tǒng)、開發(fā)工具版本信息和相關(guān)崩潰日志或控制臺消息。- Apple Developer website. Get the latest development information as well as technical documentation for Xcode.
蘋果開發(fā)者網(wǎng)站。獲取最新的開發(fā)信息,例如Xcode的技術(shù)文檔。- Xcode homepage. Get high-level information about the latest release of Xcode. Download current and beta Xcode releases.
Xcode主頁。獲取Xcode最新發(fā)布版的高品質(zhì)信息。下載當(dāng)前版本、beta版的Xcode。- For help with using Xcode, use the built-in help by choosing Help > Xcode Help.
choosing Help > Xcode Help打開內(nèi)置Xcode使用幫助
Deprecations and Removal Notices
沖突和棄用移除注意
- iOS 11 no longer supports armv7 or armv7s (32-bit). If an iOS target has an iOS Deployment Target of 11, then it will not build for 32-bit. iOS targets with an iOS Deployment Target earlier than 11 will still build for 32-bit by default. (32163517)
iOS 11不再支持 armv7或 armv7s (32-bit)。如果一個iOS
target有一個iOS 11 Deployment Target,它將不支持32位。- Xcode Server no longer includes the capacity to host Git repositories. To continue using repositories that were set up in macOS Server, configure a new remote and push your code to that remote. After upgrading to Xcode 9, any existing repositories will be archived in /Library/Developer/XcodeServer/HostedRepositories. (31243129)
Xcode服務(wù)器不再包含Git倉庫。在macOS服務(wù)器建立倉庫以繼續(xù)使用倉庫,配置新的遠程倉庫,并提交代碼到遠程倉庫。更新到Xcode 9之后,任何存在的倉庫將打包到/Library/Developer/XcodeServer/HostedRepositories。- Xcode’s Subversion integration will be deprecated in a future release. (33041914)
Xcode的版本管理整合將會被棄用。- The new build system no longer runs shell script build phases with the legacy COMMAND_MODE, which means utility programs, such as echo, will now conform to Version 3 of the Single UNIX Specification. (33875525)
新的編譯系統(tǒng)不再用老的COMMAND_MODE命令模式去執(zhí)行構(gòu)建階段shell腳本語句,這意味著例如echo回聲等應(yīng)用程序,現(xiàn)在將符合單一UNIX規(guī)范的第3版。
??我的問題:棄用舊的COMMAND_MODE命令模式執(zhí)行構(gòu)建階段shell腳本語句,那么新的COMMAND_MODE命令模式是什么?構(gòu)建階段的腳本都有哪些常見的應(yīng)用呢?
Xcode 9集成開發(fā)環(huán)境的新特性
General
通用部分
- A file with a base name of FooTest or FooTests is now considered a counterpart of a file with a base name of Foo for navigation and the Assistant Editor. (28981734)
一個文件的名字基于FooTest或FooTests將視作基于Foo對應(yīng)的導(dǎo)航和助理編輯器。
??我的問題:比如呢?-runFirstLaunch
, a new flag inxcodebuild
interactively checks the status of the license agreement and install any packages required for launching Xcode. (23529342)
-runFirstLaunch
是一個新的動態(tài)檢查許可協(xié)議狀態(tài)和安裝啟動Xcode的必須包的標(biāo)識。
??我的問題:怎么應(yīng)用呢?- Core NFC can now be enabled via the Capabilities tab in Xcode. (32520707)
Core NFC(近距離無線通訊技術(shù))可以通過Xcode功能選項卡啟用。
??我的問題:在哪里應(yīng)用呢?
Source Editor
源代碼編輯器
- You can now increase and decrease the source editor font using Command-plus and Command-minus. (21423189)
可以通過Command-plus和Command-minus放大和縮小編輯器字體。- When text is selected, typing a opening delimiter adds a matching closing delimiter at the end of the selection. Auto-matched delimiters include
" ", ( ), [ ], { }
. (29164633)
選中文本鍵入(鍵盤輸入)開始分隔符,將在選定的結(jié)尾處添加匹配的結(jié)尾分隔符。自動匹配分隔符包括“”、()、[ ],{ }
。
The Source Editor’s comment/uncomment functionality now understands that some languages, like Swift, support nesting block comments while others, like the C family languages, do not allow it. This results in more accurate commenting and uncommenting. (32193940)
源代碼編輯器的注釋/取消注釋功能識別一些語言,像Swift,支持嵌套注釋塊而其他像C語言不支持。這一結(jié)果更準(zhǔn)確的注釋和取消注釋。
??翻譯、閱讀文檔好長
Interface Builder
UIView
layout margins now have an option in the Size inspector to enable leading and trailing margins to respect RTL languages at runtime. (30086042)
UIView
布局邊距有一個可選的尺寸檢查器支持runtime運行時RTL實時語言/解釋語言約束leading and trailing
和trailing margins
。- Interface Builder supports the vertical baseline-to-baseline constraints added in iOS 11 that update spacing based on changes in the Dynamic Type size. (30086144)
- Safe Area layout guides can be enabled for any subview and for XIB files. (32956031)
出現(xiàn)兼容性問題解決方案是在xib屬性中把Safe Area Layout Guide屬性勾去掉。蘋果在iOS7中引入的Top layout guide和Bottom layout guide,這些布局指南在iOS 11中被棄用,取而代之的是Safe Area layout guides。當(dāng)一個viewcontroller 被嵌入到navigationcontroller and tab bar 中時,我們可以使用 Top layout guide和Bottom layout guide 讓view根據(jù)上下錨點自適應(yīng)內(nèi)容。在iOS11中蘋果用單獨的Safe Area屬性代替了上面的屬性。安全區(qū)域限制于頂部和底部的錨點。- Interface Builder now renders navigation bars, tab bars, and toolbars on the canvas in the same way they appear at runtime. (30983209)
界面生成器現(xiàn)在以與runtime運行時相同的方式呈現(xiàn)畫布上的導(dǎo)航欄、選項卡條和工具欄。
To use the newusesAutomaticRowHeights
property ofNSTableView
in Interface Builder, choose “Automatic (Auto Layout)” from the Size inspector and set the Row Height value. The value is used as part of the auto layout calculation. (29511510)
使用界面生成器中的NSTableView新的usesAutomaticRowHeights屬性值,從Size inspector尺寸檢查器選擇“Automatic (Auto Layout)”,并設(shè)置Row Heigh值。該值用作自動布局計算的一部分。
Interface Builder now supports setting the estimatedRowHeight of UITableView. This allows self-sizing table cells by setting the estimated height to a value other than zero, and is on by default. (17995201)
界面生成器支持設(shè)置UITableView的estimatedRowHeight。這可以通過將估計高度設(shè)置為零以外的大小來自動調(diào)整表單元格,并且默認(rèn)情況下是打開的。- Interface Builder no longer compiles for iOS 6. Documents with older deployment targets can still be read, and their frames can be transitioned to iOS 7 and later. (28726486)
- Interface Builder uses
UIView.safeAreaLayoutGuide
as a replacement for the deprecated Top and Bottom layout guides inUIViewController
. To use the new safe area, select Safe Area Layout Guides in the File inspector for the view controller, and then add constraints between your content and the new safe area anchors. This prevents your content from being obscured by top and bottom bars, and by the overscan region on tvOS. Constraints to the safe area are converted to Top and Bottom when deploying to earlier versions of iOS. (29323293)- Interface Builder allows configuring column sizing properties on UISplitViewController. (18359423)
Interface Builder supports settingtextContentType
on classes conforming to theUITextInputTraits
protocol. This improves the ability of AutoFill to populate with appropriate data, including Username and Password on iOS 11. (25019432)
自動填充用戶名、密碼。
Main Thread Checker
主線程檢查器
- Main Thread Checker is a new runtime tool that finds calls to APIs in AppKit, UIKit, and WebKit that must be made from the main thread, but are made on other threads. These calls are reported as runtime issues. Main Thread Checker is automatically enabled during debugging and can be disabled in the Diagnostics tab of the Scheme editor. (29951764)
主線程檢查器是一個新的runtime tool
運行時工具,發(fā)現(xiàn)調(diào)用應(yīng)該在主線程卻在其他線程的AppKit、 UIKit、WebKit的APIs。這些調(diào)用將作為runtime issues
運行時異常。主線程檢查器在調(diào)試過程中自動啟用,并且可以在Scheme editor
方案編輯器的Diagnostics tab
“診斷”選項卡中禁用。
Undefined Behavior Sanitizer
未定義行為清除器
- Undefined Behavior Sanitizer is a new runtime tool that finds several types of undefined behavior in C languages, including integer overflows, invalid casts, and alignment violations. It has low overhead and can be enabled in the Diagnostics tab of the Scheme editor. Undefined Behavior Sanitizer is compatible with all other sanitizers. (15425728)
Undefined Behavior Sanitizer
是一個新的runtime tool
運行時工具,用于發(fā)現(xiàn)幾種C語言undefined behavior
未定義行為,包括整型溢出、invalid casts
、alignment violations
。它的開銷很低,可以在方案編輯器的“診斷”選項卡中啟用。未定義行為清除器與其他清除器是兼容的。
Undefined Behavior Sanitizer can optionally detect nullability annotation violations at runtime. Go to Build Settings then set “Enable Nullability Annotation Checks” to “Yes” in the Undefined Behavior Sanitizer section. (30619298)
Address Sanitizer
地址清除器
- Address Sanitizer has been extended to check for cases when the scope of a variable has ended, but the underlying memory is used. It also has a new optional check that detects cases where memory backing a local variable is used after the function has returned. This check, for the use of stack memory after return, can be enabled in the Diagnostics tab of the Scheme editor. (32308829)
- Address Sanitizer is now compatible with Malloc Scribble. (32359908)
Thread Sanitizer
線程清除器
- Thread Sanitizer has been extended to catch higher-level races on Objective-C and Swift collections, such as writing to a mutable array from different threads without using proper synchronization. (26798589)
- Thread Sanitizer has been extended to catch when multiple threads call mutating methods on the same struct without synchronization. It will also catch many cross-thread violations of Swift’s rule requiring exclusive access to memory. (30455576)
Asset Catalog
資源管理文件
- Asset catalogs now support named colors, which can be referenced in Interface Builder documents. (28900538)
Asset catalogs
現(xiàn)在支持命名顏色,這可以Interface Builder
頁面生成器文檔引用。
Asset catalogs now support high-efficiency image formats, including .avci, .heic, and .heif file extensions. (29959599)
Debugging
- iOS devices and Apple TV can now be debugged over the network. For more information, see the topics in Xcode Help > Run and debug > Network debugging. (10968305)
Xcode Help > Run and debug > Network debugging- The View Debugger now supports visual debugging of SpriteKit and SceneKit scenes. SpriteKit nodes are shown in the view hierarchy. For SceneKit scenes, select the SCNScene in the debug navigator to open the snapshot in the SceneKit editor. Changes in the SceneKit editor when it is in runtime debugging mode can be saved and do not change your app. (29169315)
視圖調(diào)試器現(xiàn)在支持SpriteKit和SceneKit場景可視化調(diào)試。SpriteKit節(jié)點在視圖層次中顯示。對于SceneKit場景,在調(diào)試導(dǎo)航選擇SCNScene
,在SceneKit編輯器打開快照。在運行時調(diào)試模式,SceneKit編輯器更改可以保存,并且不會改變app。- Memory graph files exported by Xcode or generated by the leaks command line tool will now save allocation backtraces if malloc stack logging is enabled. This makes the backtraces available for all the tools that support memgraph files (leaks, vmmap, Xcode). (25399716)
Project Navigator
項目導(dǎo)航欄
- Groups in the Project Navigator are now more closely associated with directories in the file system.
- Dragging files between groups in the Project Navigator now moves the files in the filesystem, and updates any associated SCM working copies.
- Creating, renaming, and deleting groups now performs the corresponding changes in the connected directory in the filesystem, if one is defined.
- Removing a group’s connection to a directory in the filesystem can now be done in the file inspector by clicking on the clear (X) button.
- Changing an association to a file or group can be now be done quickly by dragging and dropping the file or folder onto the “Location” section of the file inspector.
(28612132)
Source Control
版本控制
-The Source Control pane in Preferences includes configuring Git and SVN ignore file lists, and for configuring your Git author information. (10544339)
- Xcode 9 integrates with GitHub. You can easily manage your account from the Xcode preferences window, including support for two-factor authentication, and configure an SSH key to be used when performing Source Control operations against GitHub. (28775680)
- Xcode 9 includes a brand new Source Control navigator where you can easily see the working copies for your project or workspace. Each working copy lists branches, tags and remotes, and you can quickly see the currently checked out branch and push/pull counts for those branches. The gear and contextual menus allow you to create branches and tags, configure remotes, and perform tasks like checking out a revision or branch and merging changes between branches. New history and review files editors are displayed when clicking on a branch or tag in the Source Control navigator. You’ll see a full history for your branch or tag, including avatars, author and commit information and each commit is annotated with the branches and tags that correspond to that commit. A new SCM inspector allows you to see more details on a commit and double clicking a commit reveals the Review Files Editor (which shows all the files that were modified as part of a commit and the changes that were made). (29054970)
- Xcode 9 will no longer show repositories that you have cloned source code from in the past in the Preferences/Accounts window. Instead, you can manage your GitHub and GitHub Enterprise accounts. (30191709)
- Xcode 9 includes a brand new Clone... window that integrates directly with GitHub to show you favorite, private/personal and organizational repositories for all of your accounts. For each repository, you’ll see metadata and be able to view the project Readme, and clone with one- click. (30960520)
- Xcode 9 will now automatically fetch from remote tracking branches and mark files that have been updated in the project navigator, and show push/pull counts in the Source Control navigator. (31839384)
- Xcode 9 includes support for one-click clone from GitHub.com in Xcode when viewing repositories in your Web Browser. (32294826)
Localization
國際化
- Export and import of localizations via XLIFF now supports stringsdict files, including support for using the correct plural variants per language. (16785521)
- Xcode no longer exports localizations for test targets, unless they specifically contain localized resources. (16813531)
- Xcode now supports XLIFF export for source files that use encodings other than UTF–8. (18944510)
Signing and Distribution
簽名和發(fā)布
The distribution workflow has been enhanced to support manual signing. Manual signing allows you to specify the precise set of distribution signing certificates and provisioning profiles that you want to use when distributing your app. xcodebuild -exportArchive also supports manual signing, with new additions to the ExportOptions plist format for specifying a signingStyle, a signingCertificate, and a provisioningProfiles dictionary. See xcodebuild -help for the full list of supported ExportOptions keys.
When automatically signing for distribution, Xcode will now create and use only Xcode- managed distribution provisioning profiles. This behavior is functionally analogous to automatic signing for development, and means that Xcode will no longer create or modify any of your manually created distribution provisioning profiles. Xcode-managed distribution provisioning profiles are supported for all distribution methods except for Developer ID distribution. xcodebuild -exportArchive now fully supports automatic signing, including creating and updating signing assets, if you pass the -allowProvisioningUpdates flag.
In addition, when Xcode detects that you must create a new distribution signing certificate, it will now prompt you for permission to create one and provide you with a convenient means to export the signing certificate for safekeeping or for sharing with other team members. Revoking distribution signing certificates is no longer supported within the distribution workflow. The distribution workflow also no longer requires you to specify a team if your app was signed when you built your archive.
Finally, the distribution workflow now outputs several additional files alongside your exported app: a DistributionSummary plist, a Packaging log, and an ExportOptions plist. The DistributionSummary plist describes the content of your exported app, including information about its signature; whether it inclusion symbols and bitcode; and its embedded content. The Packaging log is akin to a build log, and contains all of the commands used to transform the archived application into a packaged app for distribution. The ExportOptions.plist encapsulates all of the choices you made throughout the distribution workflow. It can be passed to xcodebuild -exportArchive to automate distribution of your app for continuous integration. (29054761)
When Code Coverage is enabled in the Test action of a scheme, Xcode will no longer place the build intermediates and products from the Test action into a separate build location, and will instead use the same location as the Run action. Enabling Code Coverage for the Test action now also enables it for the build performed by the Run action. This causes a build for the Run action to take approximately 3% longer, but allows the Test and Run actions to share build products and intermediates, reducing overall build times when alternating between these actions. (32079317)
When exporting a Swift app for a platform that supports App Thinning, the distribution workflow shows a new option “Strip Swift Symbols” that controls whether Swift symbols should be stripped out of the Swift standard libraries. This significantly reduces the size of the Swift libraries. If the lack of Swift symbols causes problems, such as when using dladdr(), this setting can be disabled. (31669406)
Testing
測試
- When running tests, xcodebuild will no longer launch Simulator. (27385435)
- XCTest includes a new teardown block API for cleaning up test state after your test completes.
(28097197)- XCTest includes a new API that can be used to wait on an XCUIElement existing before proceeding. (28483267)
- XCTest now includes support for targeting multiple applications in a single UI test, including monitoring application state and making a backgrounded application the frontmost application. (28948745)
- XCTest types that are closely associated with a particular class such as XCUIElement.Type are available as nested types in Swift 4. (29000570)
- XCTest includes XCTActivity, a new API for grouping UI test activity together in test reports and logging. (30401267)
- XCTest includes XCTAttachment, a new API for bundling diagnostic test resources such as rich logging along with your test results. (30478677)
- By default, xcodebuild tests on multiple destinations simultaneously. To disable this feature, provide the -disable-concurrent-testing command line argument. (31964004)
- Screenshots captured automatically during UI testing are now saved as images in the JPG format instead of PNG. (32719585)
- XCTest now includes new scheme-level configuration options for disabling automatic screenshots, and new API for capturing screenshots of partial, individual or multiple displays. (21327915)
- UI testing now supports targeting LSUIElements-based applications. (21344280)
- Xcode 9 includes significant improvements to UI testing around performance when targeting applications built and installed by Xcode. XCTest now includes firstMatch for restricting query execution in UI tests. (29544176)(22980005)
- Tests can now be configured to run tests in a specific language and region using a scheme setting in Xcode. (28897796)
Crashes Organizer
崩潰分析
- The Crashes Organizer will symbolicate unsymbolicated logs when selected using local .dSYMs indexed by Spotlight. (22550064)
Templates
模板
- In Xcode 9, the template macro expansion subsystem has been reworked. Improvements include:
- A new standard macro named FILEHEADER has been added that is the content for the standard file header comment.
- Macros can now be defined in terms of other macros. For example the new FILEHEADER macro is defined in terms of macros like FILENAME and COPYRIGHT. COPYRIGHT, in turn is defined in terms of ORGANIZATIONNAME and YEAR.
- Macro expansions can apply modifiers. This was faked in the old implementation by setting special macros that were made by turning other macros into identifiers or xml-safe variants, but now these modifiers can be used with any macro. The syntax is MACRONAME:modifier. Multiple modifiers can be chained like MACRONAME:modifier1,modifier2
- Custom macro definitions and overrides can now be supplied.
For more information, choose Help > Xcode Help and see the topics in Appendixes > Text Macros. (5775785)
Server
服務(wù)器
- Xcode Server and xcodebuild now support running tests in parallel on multiple devices and simulators. Bots can be configured to enable or disable parallel testing on devices, and by default bots will prefer to test in parallel. The output produced by xcodebuild when testing in parallel has been updated (any automated tooling relying on this output may need to be updated). (14254639)
- Xcode Server now supports automatic and manual provisioning configurations for your project. For schemes that contain targets that use the automatic signing style, an agent or admin of the developer team can add your server to your team from the updated bot editor. If your scheme requires manually specified certificates or profiles, they can be easily shared with the server from the new Signing tab in the bot editor. (15437174)
- Xcode Server now supports configuring additional arguments that will be passed to xcodebuild when integrations run. (23578597)
- Xcode Server now supports sending an “all clear” email notification when all issues being tracked by a bot have been resolved. (26179348)
- Xcode Server no longer requires the macOS Server app. Configure your server and bots using the Server & Bots tab in Xcode’s Preferences. (28211693)
- Bots can now be configured to run tests in a specific language and region. (30382604)
- Bots now support configuration of an Export Options Plist that will be used when exporting an installable product from an archive. (31895193)
Simulator
模擬器
Simulator now supports face-up and face-down orientations on supported devices. (11393667)
Simulator now respects the system screenshot directory instead of always saving screenshots to the desktop. (26127809)
Simulator can now attach to simulators started from the command line and detach from simulators without shutting them down. To detach when closing a device window or quitting the app, hold down Control. You will be asked whether to shutdown or detach. A checkbox is provided to make whichever behavior you choose the default. To change the default, repeat the same procedure. (31004084)
Simulator now provides a Share Extension. Photos and videos are imported into the device photo library. Locations or pins from Maps.app set the device’s simulated location. App bundles are installed. URLs are opened in Safari. Choose “All Simulators” to install to multiple simulators simultaneously. (31150602)
Simulator now supports edge swipe gestures when the device bezel is visible. Begin your gesture just outside the screen region. (31558767)
The Simulator supports selecting the macOS audio input and output device connected to each simulated device. Use the new Audio Input and Audio Output menus under Hardware. The “System” item tracks the macOS input or output device selected in System Preferences.
To avoid having the Simulator put BT headphones into phone call mode (and decreasing audio quality) select a different input device. (32121469, 32337249) (32337249)
Simulator now supports starting multiple devices simultaneously. As a result the separate “Simulator (Watch).app” has been removed. (5687722)
Simulator shows a device bezel with buttons that send send the appropriate event to the device. (14020158)
Xcode 9.0 supports running multiple concurrent versions of the Xcode app and of any associated tools such as Simulator. Xcode 9.0 can not be run at the same time as earlier versions. (23140937)
Simulator now supports redirecting most keyboard shortcuts to a simulated device. Choose Hardware > Keyboard > Send Menu Keyboard Shortcuts to Device to turn on and off sending keyboard shortcuts to the device. A checkmark indicates that keyboard shortcuts are being redirected to the frontmost simulated device. Each device can have a different setting for this option. In addition, Simulator menus don’t display shortcuts while shortcuts are redirected.
Simulated devices now distinguish between the left and right modifier keys such as Shift, Command, Control, and Option.
System-level shortcuts such as Command-Option-D are not redirected.
Note: Pressing both the Left-Command and the Right-Command keys also turns off sending keyboard shortcuts to a device. (31990219)
The iOS 11, tvOS 11, and watchOS 4 Simulator runtimes now treat the filesystem as case sensitive to better simulate physical device behavior. (18609452)
Build System
編譯系統(tǒng)
New Build System
Xcode 9 includes a new build system written from scratch in Swift. It is designed for higher reliability, and it catches project configuration problems which the standard build system does not. The performance of the build system (not including compilers, linkers, and other build tools) has been dramatically improved. This new build system is built on top of the Swift open source llbuild project.In Xcode 9.0, the new build system is disabled by default, but it can be enabled for a project or workspace in the settings accessed with the
Workspace Settings...
orProject Settings...
menu item in the File menu. Passing the-UseNewBuildSystem=YES
flag toxcodebuild
will also force it to use the new build system for a command-line build. The new build system will become the default build system in a future version of Xcode.While the new build system is highly compatible with existing projects, some projects may require changes when adopting it. Expected changes are due to the following:
- The new build system is more strict about detecting and producing an error if a cycle is detected between elements in the build, as cycles can cause unnecessary rebuilds, degrading build performance. To resolve this issue, ensure that all files are produced earlier in the build than when they are used. For example, if a target both produces an output and depends on other targets which use that output, move the production of the output into its own target which can be run earlier in the build.
- It is an error for any individual file in the build to be produced by more than one build command. For example, you may not declare the same output file from two shell script phases in separate targets, if they are both built at once (since the build system has no way to decide which to use). To resolve this, factor out any such tasks into a single target that can be depended upon by anyone requiring it.
- If an output file which is generated by a shell script is used as an input elsewhere in the build (for example, to another shell script), then that output must be declared as an explicit output by the script which generates it; otherwise the build system may attempt to search for the file before it has been generated, causing the build to fail.
- The traditional header map which was generated when the “Always Search User Paths” (ALWAYS_SEARCH_USER_PATHS) setting was YES is not supported by the new build system. Instead, projects should set ALWAYS_SEARCH_USER_PATHS to NO and should migrate to using modern header include syntax:
- Add any needed header files which are in the project repository to the Xcode project, to ensure they are available for use in #include (via the project wide header map).
- Use quote-style include ("foo.h") for project headers, and reserve angle-bracket include (<foo.h>) for system headers.
- The new build system will pass undefined_arch as the value for the ARCH environment variable when running shell script build phases. The value was previously not well defined. Any shell scripts which were depending on this value should instead be written to behave correctly for all defined architectures being built, available via the ARCHS environment variable.
- The new build system does not support the standard “clean” behavior, instead supporting “clean build folder”. (19209225)
- The module.modulemap file that Xcode generates for a target containing Swift and defining a module now includes requires objc so it can be used by languages other than Objective-C (such as C++). (28650820)
- The new “Strip Swift Symbols” (STRIP_SWIFT_SYMBOLS) build setting, which is enabled by default, adjusts the level of symbol stripping so that when the linked product of the build is stripped, all Swift symbols are removed. This significantly reduces the size of Swift frameworks. If the lack of Swift symbols causes problems, such as when using dladdr(), this setting can be disabled. To view the exported symbols from file that has been stripped, use “xcrun dyldinfo - export” instead of nm. (31306055)
- The build setting “Separate Strip” [SEPARATE_STRIP] is no longer displayed in the build settings editor, and it is no longer supported. Xcode always strips binaries in a separate task and no longer instructs the linker to perform the strip. (31584192)
- Schemes with Code Coverage enabled (in the Test action) will now always build with Code Coverage, including for the Run and Launch actions. This reduces the need to build multiple versions of the application. Users who require code coverage to be off for their non-test actions can explicitly use a separate scheme with coverage disabled. (31848014)
- A new build setting for the swift compiler, “Precompile Bridging Header” [SWIFT_PRECOMPILE_BRIDGING_HEADER], has been added. When enabled – which it is by default – this setting adds a new optional step in mixed-source builds called ‘PrecompileSwiftBridgingHeader’, that improves overall build time. If unexpected errors occur during this step, disabling the build setting will omit this step. (31851450)
- There is a new build setting “Swift 3 @objc Inference” [SWIFT_SWIFT3_OBJC_INFERENCE] which controls how the Swift compiler infers @objc for declarations. By default it will use the declared Swift version in the target to perform this inference, but this setting can be used to explicitly direct the Swift compiler to use either Swift 3 to Swift 4 inference rules. (32121595)
- Autocreated schemes are no longer saved to disk unless they’ve been edited. This helps prevent the accumulation of schemes for targets which are deleted, or are added to other schemes. (30266825)
- xcodebuild can now communicate with the Apple developer website to create and update provisioning profiles, signing certificates, and app IDs for targets that use automatic signing. To enable this behavior, first add your Apple ID in Xcode’s Accounts preferences window, and then pass the -allowProvisioningUpdates flag to xcodebuild when building. (27572834)
- Xcode supports a new build setting, CODE_SIGN_STYLE, which can be used to override a target’s signing style to Automatic or Manual when using xcodebuild. (28077832)
Core Data
- When generating code for Swift 4, data model code generation has been updated to use Swift structs when possible. Code generation for Swift 3 is unchanged. (27512827)
- The data model editor presents a unified interface for Core Data’s new fetch indexes feature as well as its existing property index and entity compound index features. Older data models are translated into fetch index form for editing, and saved to the old file format when necessary. Compiling a data model with a Deployment Target lower than iOS 11, watchOS 4, macOS 10.13, or tvOS 11 continues to generate a compatible compiled form. (30843153)
- An attribute in a data model can now be marked as preserved after deletion, to support the Core Data persistent history tracking feature. (31204966)
- An entity can have its Core Spotlight display name expression specified directly in the data model. (31619747)
- The Xcode Core Data model editor supports creating fetch indexes from attributes, expressions, and relationships. (32407895)
- About Xcode 9
- New in Xcode 9 – IDE
- Resolved in Xcode 9 – IDE
- Known Issues in Xcode 9 – IDE
- New in Xcode 9 – Apple LLVM and Swift Compilers
- Resolved in Xcode 9 – Apple LLVM and Swift Compilers
- Known Issues in Xcode 9 – Apple LLVM and Swift Compilers