xcode 9 新特性

原文鏈接

Xcode 9的新功能

Xcode是用于為Apple TV,Apple Watch,iPad竖配,iPhone和Mac創(chuàng)建應(yīng)用程序的完整開發(fā)人員工具集。Xcode開發(fā)環(huán)境采用tvOS SDK里逆,watchOS SDK进胯,iOS SDK和macOS SDK的形式捆綁Instruments分析工具,Simulator和OS框架原押。

Xcode 9的亮點(diǎn)

Xcode 9包括整體質(zhì)量改進(jìn)以及廣泛的新功能胁镐。

全新編輯。快速诸衔,基于結(jié)構(gòu)的編輯器盯漂,可讓您智能地突出顯示和瀏覽您的代碼。包括偉大的Markdown支持笨农。

重構(gòu)就缆。重構(gòu)內(nèi)置于編輯體驗(yàn)之中,并可跨Swift谒亦,Objective-C违崇,Interface Builder和許多其他文件類型。

超快速搜索“查找”導(dǎo)航器會(huì)立即返回結(jié)果诊霹。

調(diào)試羞延。通過網(wǎng)絡(luò)無線調(diào)試iOS和tvOS設(shè)備,Metal的新調(diào)試器以及Xcode中的更多功能脾还。

源代碼管理伴箩。所有新的源代碼管理導(dǎo)航器和對(duì)GitHub帳戶的集成支持能夠快速瀏覽存儲(chǔ)庫并將其推送到云端。

Xcode服務(wù)器內(nèi)置鄙漏。運(yùn)行連續(xù)集成機(jī)器人可以在任何具有Xcode 9的Mac上運(yùn)行嗤谚,無需安裝macOS Server。

新游樂場(chǎng)模板新的iOS模板怔蚌,旨在在iPad上的Xcode和Swift Playground中運(yùn)行良好巩步。

新建系統(tǒng)。Xcode新的構(gòu)建系統(tǒng)的選擇性預(yù)覽提高了可靠性和性能桦踊。

一般

更新了使用plist文件定義文本宏的方法椅野。

為項(xiàng)目中的用戶,項(xiàng)目或特定用戶定義文本宏。

自定義新的文件頭竟闪。有關(guān)更多信息离福,請(qǐng)參閱Xcode幫助中的自定義文件標(biāo)題

更新了索引引擎炼蛤,以便在編譯時(shí)對(duì)索引文件進(jìn)行索引妖爷。

將“設(shè)備”窗口拆分為設(shè)備和模擬器的單獨(dú)窗格。

資產(chǎn)目錄

命名顏色支持理朋。

添加了廣泛的應(yīng)用程序圖標(biāo)絮识。

在App Icon集中增加了一個(gè)較大的iOS營(yíng)銷圖標(biāo)。

添加了保留圖像矢量數(shù)據(jù)以選擇動(dòng)態(tài)類型縮放的選項(xiàng)嗽上。

增加了對(duì)HEIF圖像的支持次舌。

建筑與連接

新的Xcode 9 - Swift靜態(tài)庫支持。

增加了對(duì)包含Swift代碼的靜態(tài)庫目標(biāo)的支持炸裆。

Xcode 9中的新功能 - 在Swift中編寫的新構(gòu)建系統(tǒng)的預(yù)覽垃它。目前鲜屏,該系統(tǒng)是可選的烹看,但它將成為未來版本的Xcode中的默認(rèn)設(shè)置

添加了一個(gè)以Swift編寫的新構(gòu)建系統(tǒng)的預(yù)覽。

提供更高的可靠性

捕獲許多項(xiàng)目配置問題洛史。

提高整體構(gòu)建系統(tǒng)性能惯殊。

注意,構(gòu)建系統(tǒng)性能不包括構(gòu)建系統(tǒng)使用的編譯器也殖,鏈接器和其他工具土思。

要選擇項(xiàng)目或工作區(qū)的新構(gòu)建系統(tǒng),請(qǐng)選擇“文件”>“項(xiàng)目設(shè)置”或“文件”>“工作區(qū)設(shè)置”忆嗜,然后選擇“構(gòu)建系統(tǒng)”類型的“新建構(gòu)建系統(tǒng)(預(yù)覽)”己儒。有關(guān)與現(xiàn)有項(xiàng)目兼容的注意事項(xiàng),請(qǐng)參閱Xcode發(fā)行說明捆毫。

功能

iOS熱點(diǎn)和多路徑TCP的新配置闪湾。

New network configurations, including content filtering, proxying DNS queries, and proxying TCP and UDP connections.

New background mode for watchOS for use with audio recording and turn-by-turn directions.

New mode for tvOS background fetch.

Core ML

New in Xcode 9 – Core ML editor.

Generate strongly typed interfaces for the model.

Model compilation for on-device usage.

Debugging

New in Xcode 9 – Network debugging for iOS and tvOS devices.

Debug iOS and tvOS devices over WiFi or wired networks.

Connect through Bonjour or enter an IP address.

To enable network debugging, seePair a wireless devicein Xcode Help.

New in Xcode 9 – GPU frame capture and GPU overrides.

View command buffers, attachments, resources, and call stacks.

Modify shaders and save changes to your app.

Move through the timeline for the sequence.

Inspect and modify values for individual pixels in attachments including color values, alpha, depth, and more.

Experiment with the rendering state without modifying code by minimizing texture bandwidth, minimizing number of rendered pixels, disabling the blending stage, showing only the wireframe, and scaling the amount of tessellation.

New in Xcode 9 – Undefined Behavior Sanitizer.

Find sources of program crashes, unexpected behaviors, and incompatibilities with future versions of Xcode.

Detect several types of undefined behaviors in C languages such as integer overflow, invalid casts, and alignment violations.

Enable theUndefined Behavior Sanitizerin the Diagnostics pane of the scheme editor.

New in Xcode 9 – Main Thread Checker.

Detect AppKit, UIKit, and WebKit method calls that are not made on the main thread.

Automatically enabled during debugging, and can be disabled in the Diagnostic tab of the scheme editor. Use theMain Thread Checkerwith Swift and C languages.

Main Thread Checkerworks with Swift and C languages.

Enhanced the Breakpoint navigator with deep filtering.

Visual indicators for modified breakpoints.

Extended the view debugger to show view controllers, and to work with SceneKit and SpriteKit views.

Enhanced iOS energy gauge.

Documentation

New unified browser that integrates reference, sample code, and articles.

Improved documentation search.

New jump bar for navigating between pages.

Integrated sample code downloading.

Instruments

New split view for pinning graphs in the graphing area of a trace document.

Moved the strategy picker into a new toolbar at the top of the trace document and added a new All strategy.

Enhanced Metal debugging instrument.

Metal system trace VR support for viewing events such as compositor activity, pose queries, and more.

Interface Builder

Named colors from the asset catalog.

New margin and baseline view constraints.

Auto Layout safe-area guides.

Full-screen watchOS apps.

Metal 2 Support

New in Xcode 9 - Capture API.

Define explicit capture boundaries in your code.

Use the newMTLCaptureManagerclass and the newMTLCaptureScopeprotocol to set, manage, and trigger capture boundaries programatically.

Use the extended Xcode GPU Capture UI to start and stop captures manually. You can also use Xcode to capture API boundaries defined in your app.

New in Xcode 9 - GPU counters.

Analyze detailed profiling metrics about a specific GPU capture. In iOS and tvOS, GPU counters are shown as a timeline of command encoders; in macOS, GPU counters are shown as a timeline of draw or dispatch calls.

Examine runtime performance of render or compute pipeline stages, such as the vertex shader, fragment shader, compute kernel, and more.

Compare the amount of GPU time spent in each pipeline stage to find your performance bottlenecks.

New in Xcode 9 - GPU remarks.

Find optimization opportunities in your Metal shading language code.

Debug device-specific runtime issues in the shader editor.

Follow direct resolutions and instructions to improve your code.

New in Xcode 9 - Smart filtering.

Find specific debug information by typing into the debug navigator. Xcode dynamically displays suggestions as you type and highlight matching text, such as resources, pixel formats, function names, object labels, and more.

Filter search results by selecting options from a predefined menu of Metal objects.

Use multiple filters with many matching conditions.

New in Xcode 9 - Virtual Reality (VR) support.

View VR submissions and left-eye/right-eye submitted surfaces.

Texture inspection for inspecting values of individual pixels in render targets, such as color, alpha, depth, and more.

Inspection of output vertex attributes in the buffer editor.

Data tips support for Metal objects such as textures, buffers and samplers.

Refactoring

Rename a symbol in a single file or in a project across Swift, C, Objective-C, C++ files, and Interface Builder files.

View all the possible changes in one editor pane.

Convert method signatures between Swift and Objective-C formats.

Update properties, getters, setters, and synthesized iVars as needed.

Apply a fix-it everywhere with one button.

Automatically fill in missing cases in switch statements, and mandatory methods for protocol conformance with one click.

Extract method functionality for all supported languages, along with other language-specific local refactoring.

Simulator

New in Xcode 9 - Multiple concurrent simulators.

Run multiple simulators at the same time.

Run more tests in parallel.

Test synching and other multidevice workflows.

New bezel for iOS and watchOS simulators includes the hardware controls. Use the bezel to move or resize the simulated device.

Share information with Simulator from Maps, Photos, and Safari.

Hold down the Option key when closing a simulated device or quitting Simulator to keep simulators running after closing the window or quitting Simulator for better integration with thesimctlcommand of thexcruncommand line tool.

Record videos of simulators.

Open the new Simulator documentation by choosing Help > Simulator Help.

Source Control

New source control navigator for viewing branches, tags, and remote repositories for the current workspace.

New source control inspector shows details for the selected navigator item.

New editor for branch history including a jump bar for easy navigation.

New side-by-side editor for file diffs.

Easier and faster access to common tasks.

GitHub account integration for easy browsing and one-click creation of a project and the associated GitHub repository.

Source Editing

New in Xcode 9 – New source editor.

Faster and more versatile Find and replace.

Fast scrolling for files of any size.

Direct manipulation of code structure such as tokens and blocks.

Redesigned integration for source control.

Redesigned presentation of error and warning messages.

Support for Markdown.

Swift

New in Xcode 9 – Swift 4.

One compiler for Swift 4 and Swift 3. You can compile Swift 4 and Swift 3 targets together in the same project.

Improved migration experience that supports migrating only select targets to Swift 4. See,Migrate to Swift 4 @objc inferencein Xcode Help.

Faster generic code and decreased code size.

Testing

New in Xcode 9 – Parallel device testing.

Added new APIs to XCTest.

Control and capture screenshots.

Group test activities.

Test attachments.

Cleanup test state in a teardown block.

Target multiple apps in one UI test.

Run tests using a specified language and region.

Xcode Server

New in Xcode 9 - Built in Xcode Server.

New Server & Bots pane in Preferences for configuring Xcode Server and for setting Bot permissions.

Added support for 2-factor authentication.

Updated functionality for bots.

Support automatic and manual provisioning workflows.

Pass additional arguments toxcodebuild.

Run tests in parallel on devices and Simulator.

Configure language and region for tests.

Send "all clear" emails notifications.

Compatibility

Xcode 9.0 requires a Mac running macOS Sierra 10.12.4 or later.

Installation

You obtain Xcode 9 from the Mac App Store. It is a free download that installs directly into the Applications folder. By default, Xcode downloads developer documentation in the background for offline reading; it also automatically downloads documentation updates. This behavior can be changed after installation using the Downloads preferences pane.

Developer Resources

The Apple Developer Program provides access to the App Store, Mac App Store, and Apple TV App Store, additional support and documentation, and signing resources for testing and deployment on Apple TV, Apple Watch, iPad, iPhone, and iPod touch devices. For more information, visit theApple Developer Program website.

VisitApple Developer Forumsfor discussions about any Apple developer software, including prerelease products.

For the latest security information, visitApple security updates.

About SDKs and Simulator

A software development kit (SDK) is a collection of frameworks (libraries, headers, and resources) that represent the API for a specific watchOS, iOS, or macOS version. Most of the functionality your app gets from an SDK is actually provided by the host operating system, which sets the correct base SDK and OS Deployment Target settings that are critical for app compatibility. Xcode automatically builds with the latest SDK and targets the latest OS.

If your app doesn’t require the latest OS features, you can configure it to run on a previous version of the platform operating system by selecting the OS Deployment Target option in the Xcode Project settings. If your project was created in an older version of Xcode, you can let Xcode update your project. For details on this feature, seeProject Modernization.

Important:Before submitting your app to the App Store, you must test on a device running your supported target OS version or versions.

Automatic Signing

Changes to the signing processes may impede your development if you're working on an older project that has not been updated to the current signing process.

The recommended approach for both enterprise and App Store developer accounts is to use automatic signing in Xcode to code sign apps during both development and distribution. See Xcode Help for documentation on automatic signing. If you have an older project that isn't configured to use automatic signing, readTechnical Q&A (QA1814) "Setting up Xcode for Automatic Provisioning"to learn how to reconfigure your Xcode project.

Consider automatic signing before using other techniques. If your projects do require manual signing, search for “manually sign” in Xcode Help to review current manual signing practices.

Project Modernization

When you open a project, Xcode evaluates it to see whether any settings should be updated. This feature makes it easy to ensure your projects conform to the latest SDKs and best practices.

Open the issue navigator to see whether anything in your project needs to be updated. You can also select the project in the project navigator, and then choose Editor > Validate Settings.

If the issue navigator lists modernization issues, click the issue to see a dialog that explains the updates that should be made and that lets you perform any or all of them.

After you click Perform Changes, regardless of whether you choose to make all the changes, Xcode does not show the warning again. To rerun the check, select your project in the project navigator and choose Editor > Validate Settings.

See Also

To learn more about using Xcode, choose Help > Xcode Help.

下一個(gè)

版權(quán)所有?2017 Apple Inc.保留所有權(quán)利。使用條款|隱私政策|更新日期:2017-09-19

反饋

*

*

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末绩卤,一起剝皮案震驚了整個(gè)濱河市途样,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌濒憋,老刑警劉巖何暇,帶你破解...
    沈念sama閱讀 206,013評(píng)論 6 481
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場(chǎng)離奇詭異凛驮,居然都是意外死亡裆站,警方通過查閱死者的電腦和手機(jī),發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 88,205評(píng)論 2 382
  • 文/潘曉璐 我一進(jìn)店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來遏插,“玉大人捂贿,你說我怎么就攤上這事「斐埃” “怎么了厂僧?”我有些...
    開封第一講書人閱讀 152,370評(píng)論 0 342
  • 文/不壞的土叔 我叫張陵,是天一觀的道長(zhǎng)了牛。 經(jīng)常有香客問我颜屠,道長(zhǎng),這世上最難降的妖魔是什么鹰祸? 我笑而不...
    開封第一講書人閱讀 55,168評(píng)論 1 278
  • 正文 為了忘掉前任甫窟,我火速辦了婚禮,結(jié)果婚禮上蛙婴,老公的妹妹穿的比我還像新娘粗井。我一直安慰自己,他們只是感情好街图,可當(dāng)我...
    茶點(diǎn)故事閱讀 64,153評(píng)論 5 371
  • 文/花漫 我一把揭開白布浇衬。 她就那樣靜靜地躺著,像睡著了一般餐济。 火紅的嫁衣襯著肌膚如雪耘擂。 梳的紋絲不亂的頭發(fā)上,一...
    開封第一講書人閱讀 48,954評(píng)論 1 283
  • 那天絮姆,我揣著相機(jī)與錄音醉冤,去河邊找鬼。 笑死篙悯,一個(gè)胖子當(dāng)著我的面吹牛蚁阳,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播鸽照,決...
    沈念sama閱讀 38,271評(píng)論 3 399
  • 文/蒼蘭香墨 我猛地睜開眼螺捐,長(zhǎng)吁一口氣:“原來是場(chǎng)噩夢(mèng)啊……” “哼!你這毒婦竟也來了移宅?” 一聲冷哼從身側(cè)響起归粉,我...
    開封第一講書人閱讀 36,916評(píng)論 0 259
  • 序言:老撾萬榮一對(duì)情侶失蹤,失蹤者是張志新(化名)和其女友劉穎漏峰,沒想到半個(gè)月后糠悼,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 43,382評(píng)論 1 300
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡浅乔,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 35,877評(píng)論 2 323
  • 正文 我和宋清朗相戀三年倔喂,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了铝条。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點(diǎn)故事閱讀 37,989評(píng)論 1 333
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡席噩,死狀恐怖班缰,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情悼枢,我是刑警寧澤埠忘,帶...
    沈念sama閱讀 33,624評(píng)論 4 322
  • 正文 年R本政府宣布莹妒,位于F島的核電站,受9級(jí)特大地震影響,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜瓮床,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 39,209評(píng)論 3 307
  • 文/蒙蒙 一丑掺、第九天 我趴在偏房一處隱蔽的房頂上張望唆缴。 院中可真熱鬧匣掸,春花似錦碰酝、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 30,199評(píng)論 0 19
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽谐丢。三九已至乾忱,卻和暖如春讥珍,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背窄瘟。 一陣腳步聲響...
    開封第一講書人閱讀 31,418評(píng)論 1 260
  • 我被黑心中介騙來泰國(guó)打工衷佃, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留,地道東北人蹄葱。 一個(gè)月前我還...
    沈念sama閱讀 45,401評(píng)論 2 352
  • 正文 我出身青樓氏义,卻偏偏與公主長(zhǎng)得像,于是被迫代替她去往敵國(guó)和親图云。 傳聞我的和親對(duì)象是個(gè)殘疾皇子惯悠,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 42,700評(píng)論 2 345

推薦閱讀更多精彩內(nèi)容