Xcode 7: Profiling Unit Tests in Instruments

January 26th, 2016

Filed under: Instruments, Xcode | 1 comment

I learned about this tip from an Apple engineer on Apple’s developer forums and felt like sharing it here. Xcode 7 lets you profile unit tests in Instruments, using the following steps: Open the test navigator. Right-click on a test or a group of tests in the test navigator. Choose Profile “testMethod”, where testMethod is […]

Xcode 7: You Can Install Your Apps on an iOS Device for Free

November 5th, 2015

Filed under: Xcode | Be the first to comment!

A common complaint from people interested in iOS development was having to pay the $99 annual fee to Apple just to put an app they created on their own iOS device. These people should install Xcode 7. Starting with Xcode 7, iOS developers can install their apps on their iOS devices without paying the $99 […]

Xcode 7: No More Snapshots

October 26th, 2015

Filed under: Version Control, Xcode | 2 comments

You can no longer take snapshots of your projects in Xcode 7. Use version control to track changes in your projects. The easiest way to start with version control is to create a new Xcode project. When you are asked where to save the project, there is a checkbox to create a local git repository. […]

Checking API Availability in Swift 2

October 12th, 2015

Filed under: Mac Development, Xcode | Be the first to comment!

When developing Mac and iOS applications, the recommended approach to support older operating systems is to use the most recent SDK and set the deployment target to the earliest operating system your application supports. Until recently the problem with this approach is there was no way to tell at compile time if your code used […]

Xcode 7: Compare Instruments Call Trees

September 28th, 2015

Filed under: Instruments, Xcode | 2 comments

A new feature of Instruments in Xcode 7 is the ability to compare two call trees in the Time Profiler instrument. This article provides a brief introduction on using this feature. Comparing two call trees is also available in the Counters template (it was disabled for me in every other template), but I’m going to […]

Xcode 7: Address Sanitizer

September 23rd, 2015

Filed under: Xcode | Be the first to comment!

Xcode 7 adds Address Sanitizer. Address Sanitizer helps find memory corruption problems, such as buffer overflows and using freed memory. Keep in mind that Address Sanitizer works only with C-based languages: C, C++, and Objective-C. If you are coding in Swift, Address Sanitizer will not help you. Also remember that your application runs slower in […]

Xcode 7: Setting Instruments Inspection Ranges

September 21st, 2015

Filed under: Instruments, Xcode | Be the first to comment!

In the version of Instruments that comes with Xcode 7, Apple removed the menu items to set inspection ranges that were in the View menu in Instruments 6. To set an inspection range in Instruments 7, click inside an instrument’s graph and drag. In the screenshot the inspection range is highlighted in blue. After setting […]

Xcode 7: Accessing Targets in the Project Editor

September 18th, 2015

Filed under: Xcode | Be the first to comment!

A change in Xcode’s project editor UI I didn’t see in the Xcode 7 betas that I see in the release version is the target list on the left side of the editor is hidden. How do you show the target list? On the left side of the screenshot below the button with four squares […]

Xcode 7: Code Coverage

September 16th, 2015

Filed under: Xcode | 2 comments

One of Xcode 7’s new features is measuring your application’s code coverage when running your unit tests. This article shows how to generate code coverage data and read code coverage statistics. For those of you unfamiliar with code coverage, code coverage measures which lines of your application code execute when the application runs. Before shipping […]

Xcode 7: Hiding Code Coverage Data

July 15th, 2015

Filed under: Xcode | Be the first to comment!

One of Xcode 7’s new features is measuring your project’s code coverage when running unit tests. Go to the scheme editor, select the Test step, and select the Gather coverage data checkbox. After running your unit tests, the Xcode editor will display code coverage data for your source code files. Code that was not exercised […]