What's new in Xcode 14?

Xcode is the complete developer toolset used to create apps for Apple TV, Apple Watch, iPad, iPhone, and Mac. Xcode 14 includes everything you need to create amazing apps for all Apple platforms.

Xcode 14 supports developing apps for iOS 16, iPadOS 16, tvOS 16, watchOS 9, macOS 13. Xcode 14 supports on-device debugging for iOS 11 and later, tvOS 11 and later, and watchOS 4 and later. Xcode 14 requires a Mac running macOS Monterey 12.4 or later.

Xcode Size

The first thing to notice in Xcode 14 is file size. It is ~30% smaller than Xcode 13 latest release. It is because Xcode 14 only includes runtimes for iOS and macOS by default and provides downloadable simulator runtime for watchOS and tvOS. Also, Xcode 14 will make the latest platforms available as we need them.

General Changes

  • Xcode 14 enables us to use a single target that can supports multiple platforms and conditionally include dependencies, code, resources, and build settings for specific platforms.

  • Xcode 14 also supports the development of DriverKit drivers for iPadOS.

  • Xcode 14 includes a default template for watchOS apps that combines the WatchKit App and WatchKit App Extension targets into a single Watch App target, simplifying code, asset, and localization management. You can deploy single-target watchOS apps to watchOS 7 and later.

Source Editor

  • Xcode 14 pins elements of the code structure to the top of the source editor as we scroll through a code. We can toggle this behavior from Xcode's Text Editing preferences. Use "Show: Code structure while scrolling".

  • Xcode 14 now provides code completion for adding an explicit Codable implementation.

  • Xcode 14 provides fix-its for missing imports for Swift files.

  • Jumping to symbol definitions or callers now gives a code sample for each location.

  • if case statements now get all cases in code completion.

  • Wrapping code with a block now automatically reindents the block code.

  • Xcode 14 provides code completion snippets for map, filter, and contains, based on variable names.

Asset Catalogs

  • Xcode 14 simplifies the app icon with a single 1024x1024 image. This image will automatically resize for its target. This applies to iOS and Apple Watch. For the existing app, choose the Single Size option in the app icon's Attributes inspector.

  • We can now paste clipboard images directly to an image slot.

  • We can now double-click on an image slot to select the file from Finder.

Build System

  • Xcode 14 provides a new Build Timeline to help identify unexpectedly long-running build tasks and bottlenecks in a build. Check the following video for more details -

  • The legacy build system has been removed from Xcode 14.

  • Building iOS project with deployment targets for the armv7, armv7s, and i386 architectures are no longer supported in Xcode 14.

  • Xcode 14 now compile targets in parallel with their Swift target dependencies.

  • With Xcode 14, we can enable sandboxing for shell script build phases using the ENABLE_USER_SCRIPT_SANDBOXING build setting. Sandboxing blocks access to files inside the source root of the project as well as the Derived Data directory. When enabled, the build fails with a sandbox violation if a script phase attempts to read from or write to an undeclared dependency, preventing incorrect builds.

Apple Clang Compiler

  • Xcode 14 doesn't require bitcode for watchOS and tvOS applications, and the App Store no longer accepts bitcode submissions from Xcode 14.

  • If bitcode is enabled for your project then Xcode 14 by default exclude the bitcode and generates a warning message.

  • New C++ projects you create in Xcode 14 will by default use C++20 language dialect.

Debugging

  • Xcode 14 now shows a new launch log in the Report navigator. The log shows the actions Xcode takes to install, launch, and debug.

  • Xcode 14 can now invoke LLDB's crash log script with xcrun crashlog <darwin_crash_log_file_path>.

Simulator

  • With Xcode 14, Simulator now supports the remote notifications in iOS 16 simulators running on macOS 13 on a Mac with Apple Silicon or T2 processors.

  • The simulator only supports the Apple Push Notification in the Sandbox environment. Device APNS registration tokens will be a unique combination of the simulator and the Mac hardware it is running on. Please check User Notifications for more information.

  • simctl now supports controlling simulated location, including running scenarios and interpolating between a list of waypoints. Run xcrun simctl location.

    Control a device's simulated location
    Usage: simctl location <device> <action> [arguments]
    
      list
          List available simulation scenarios.
    
      clear
          Stop any running scenario and clear any simulated location.
    
      set <lat1>,<lon1>
          Set the location to a specific latitude and longitude.
    
      run <scenario>
          Run a simulated location scenario (use the list action to get a list of scenarios).
    
      start [--speed=<meters/sec>] [--distance=<meters per second>|--interval=<seconds>] <lat1>,<lon1> <latN>,<lonN>...
          Set the location to a series of waypoints specified as 'lat,lon' pairs, interpolating between them over time.
          At least two waypoints are required. Use '-' to read waypoints from stdin, one waypoint per line.
    
          Speed specifies how quickly to move between waypoints in meters per second. If not specified 20m/s is used.
    
          The system will issue location updates along the path between each pair of waypoints. Use distance or interval to 
          control how often those updates are issued. Distance will issue an update every <meters> travelled without regard
          for the time between updates. Interval will issue updates at fixed times without regard for how much
          the location moves between updates.
          If neither are specified an interval of 1.0 seconds is used. If both are specified the system picks ones.
    
          Example simulating a direct line between San Francisco and New York City, with updates every km:
            set --distance=1000 --speed=260 37.629538,-122.395733 40.628083,-73.768254
    
    Latitude and longitude pairs must be specified using '.' as the decimal separator and ',' as the field separator.
    
  • You can now boot simulator devices using universal runtimes as x86_64 on a Mac with Apple silicon by using the new --arch command-line argument to simctl boot.

    xcrun simctl boot --arch=x86_64
    

Download Xcode 14 RC


You've successfully subscribed to Developer Insider
Great! Next, complete checkout for full access to Developer Insider
Welcome back! You've successfully signed in
Success! Your account is fully activated, you now have access to all content.