What’s new in Xcode 10?
Originally published on DeveloperInsider: What’s new in Xcode 10?
Xcode is the complete developer toolset used to create apps for Apple TV, Apple Watch, iPad, iPhone, and Mac. The Xcode development environment bundles the Instruments analysis tool, Simulator, and the OS frameworks in the form of tvOS SDKs, watchOS SDKs, iOS SDKs, and macOS SDK.
Supported Configurations
- Xcode 10 requires a Mac running macOS 10.13.6 or later.
- Xcode 10 includes SDKs for iOS 12, watchOS 5, macOS 10.14, and tvOS 12.
- Xcode 10 supports running multiple concurrent versions of the Xcode app and of any associated tools such as Simulator.
- Xcode 10 can coexist with previous versions of Xcode.
Dark Mode
- macOS Mojave has a new dark interface which brings dark mode to the Xcode 10. You can switch it on from System Preferences.
- Xcode 10 also gives you powerful tools for creating your own dark apps for macOS. Interface Builder lets you quickly switch your design and preview from light to dark.
- You can switch your app in and out of Dark Mode while debugging. This is all done using controls within Xcode that only apply to your app. No need to change your system settings.
General
- Library content has moved from the bottom of the Inspector area to an overlay window, which can be moved and resized like Spotlight search. It dismisses once items are dragged, but holding the Option key before dragging will keep the library open for an additional drag.
- The library can be opened via a new toolbar button, the View > Libraries menu, or the
⇧+⌘+L
keyboard shortcut. Content dynamically matches the active editor, so the same UI provides access to code snippets, Interface Builder, SpriteKit, or SceneKit items. The media library is available via a long press on the toolbar button, theView
>Libraries
menu, or the⇧+⌘+M
keyboard shortcut.
- Custom code snippets can now be added to the library via the Editor > Create Code Snippet menu item.
- Newly-created schemes are now shared by all users of an Xcode project. To create a personal scheme, uncheck the “Shared” checkbox in the “Manage Schemes” sheet.
Source Editor
- The Xcode 10 Source Editor now supports multi-cursor editing allowing you to quickly edit multiple ranges of code at once. You can place additional cursors with the mouse via
⌃+⇧+Click
or with column select⌥+Click+Drag
, or with the keyboard using⌃+⇧+Up
to column select up or⌃+⇧+Down
to column select down.
- With a source control-enabled project the source editor displays changes made by a developer in the gutter and shows changes made by other developers that haven’t yet been pulled into the project.
Interface Builder
- The
Stack
button in the canvas bar has been replaced with a pop-up menu containing all embedding options for the selection.
- The menu for choosing a font family in the Attributes inspector now renders a preview of each font.
- Controls using named colors from an asset catalog now update as the value of the color changes.
- Image and color inspector properties that reference an asset catalog resource have a navigation button to jump to that resource. Option + click will show the resource in the Assistant Editor.
Asset Catalog
- Support for varying image and color assets by Light, Dark, and High Contrast appearances on macOS 10.14 and above.
- Support for
CarPlay
assets. - Support for ARKit 3D
ARReferenceObject
assets. - The background of the asset catalog and view debugger can be set explicitly to light or dark so foreground elements display with sufficient contrast.
Debugging
- Xcode’s view debugger adds an option to choose between light and dark canvas background color.
- You can change the appearance of your macOS app at runtime by using the
Debug
>View Debugging
>Appearance menu
, the Override Appearance menu in the debug bar, or the touch bar. - Named colors shown in the inspector while view debugging now indicate their names and whether they are system colors.
Build System
- Again, Xcode 10 uses a new build system. The new build system provides improved reliability and build performance, and it catches project configuration problems that the legacy build system does not.
- The legacy build system is still available in Xcode 10. To use the legacy build system, select it in the
File
>Project/Workspace Settings
sheet. Projects configured to use the legacy build system will display an orange hammer icon in the Activity View.
Testing
- Xcode 10 supports running tests in parallel, which reduces the time it takes to run tests. Test parallelization is supported for macOS unit tests, as well as unit and UI tests on iOS and tvOS simulators. To enable parallelization, navigate to the scheme editor (
Product
>Scheme
>Edit Scheme
), select theTest
action followed by theInfo
tab, and then next to your test target, clickOptions
. Finally, selectExecute in parallel
(for macOS tests) orExecute in parallel
on Simulator” (for iOS and tvOS tests).
xcodebuild
has new command line options to control the behavior of parallel testing. Use- parallel-testing-enabled
to override the per-target setting in the scheme for whether parallelization is enabled. If you want to control the number of runners that are launched, use- parallel-testing-worker-count
or-maximum-parallel-testing-workers
.
Signing and Distribution
- The
Developer ID
distribution option in Xcode's Organizer now provides support for uploading apps to Apple to be notarized. After building an archive, this option can be selected in the Organizer by clicking the Distribute App button and then selecting the Developer ID method and the Upload destination. In order to upload an app to be notarized, you must enter an Apple ID in Xcode’s Accounts preferences pane with the necessary App Store Connect role and provider membership. In addition, apps uploaded to be notarized must be signed with a Developer ID certificate. The distribution workflow can create this certificate if necessary, but requires an Apple ID account with the Agent role in order to do so.
- After uploading an app to be notarized, you can view your app’s status in the Organizer window by selecting your archive and clicking the Show Status Log button. When you receive notification that your app has been notarized, you can export it from the Organizer window by selecting your archive and clicking the Export App button. The exported app contains a stapled
ticket and is ready for distribution. - Support for uploading apps to Apple via the command line. The xcodebuild -exportArchive command will perform an upload if the provided
ExportOptions.plist
contains a key nameddestination
with valueupload
. In addition, an Apple ID account with the necessary App Store Connect role and provider membership must be added in Xcode’s Accounts preference pane.
Theapp-store
,developer-id
, andvalidation
distribution methods are supported for use from xcodebuild.
Source Control
Now Xcode supports working directly with several source code collaboration platforms, including:
- GitHub and GitHub Enterprise
- Bitbucket Cloud and Bitbucket Server
- GitLab.com and GitLab self-hosted
Check out AppBox. AppBox is tool which build and deploy Development, Ad-Hoc and In-house (Enterprise) iOS applications directly to the devices from your Dropbox account. AppBox is a opensource software available on github https://github.com/vineetchoudhary/AppBox-iOSAppsWirelessInstallation .