Xcode 26

How to force resolve Swift Package in Xcode

Issue #784

Every time I switch git branches, SPM packages seem to be invalidated and Xcode does not fetch again, no matter how many times I reopen. Running xcodebuild -resolvePackageDependencies does fetch but Xcode does not recognize the resolved …

How to search using regular expression in Xcode

Issue #698

Xcode has powerful search. We can constrain search to be scoped in workspace, project or some folders. We can also constrain case sensitivity.

Another cool thing that people tend to overlook is, besides searching based on text, we can …

How to declare commands in Xcode extensions

Issue #638

Use commandDefinitions in XCSourceEditorExtension.

import Foundation
import XcodeKit

class SourceEditorExtension: NSObject, XCSourceEditorExtension {
    func extensionDidFinishLaunching() {

    }
    
    var commandDefinitions: [[ …

How to declare commands in Xcode extenstions

Issue #638

Use commandDefinitions in XCSourceEditorExtension.

import Foundation
import XcodeKit

class SourceEditorExtension: NSObject, XCSourceEditorExtension {
    func extensionDidFinishLaunching() {

    }
    
    var commandDefinitions: [[ …

How to use application will terminate in macOS

Issue #601

On Xcode 11, applicationWillTerminate is not called because of default automatic termination on in Info.plist. Removing NSSupportsSuddenTermination to trigger will terminate notification

func applicationWillTerminate(_ notification: …

How to fix library not found with SPM and CocoaPods in Xcode

Issue #572

After migrating a few pods to use SPM, some libraries fail to load. This is because the workspace now uses both SPM and cocoapods

code signature in … not valid for use in process using Library Validation: mapped file has no Team ID …

How to use test environment variables with shared scheme in Xcode

Issue #557

Use ProcessInfo to access environment variables.

ProcessInfo().environment["username"]

Duplicate main shared scheme TestApp to TestAppWithCredentials, but don’t share this TestAppWithCredentials scheme

How to do localization in Xcode

Issue #545

Xcode 10 Localization catalog and XclocReader

Xcode 11 localized screenshots

How to use xcodebuild

Issue #544

man xcodebuild

man xcodebuild

XCODEBUILD(1)             BSD General Commands Manual            XCODEBUILD(1)

NAME
     xcodebuild -- build Xcode projects and workspaces

SYNOPSIS
     xcodebuild [-project name.xcodeproj] [[-target …

How to use Derived data in Xcode

Issue #543

Workspace

Workspace has its own DerivedData folder

DerivedData
  ModuleCache.noindex
  workspace_name
    Build
      Products
        Debug-iphonesimulator
          Cat
          Dog
          Dog2
    Index
    Info.plist
    Logs …

How to use test scheme in Xcode

Issue #541

Scheme action

A scheme, either for app or test, consists of actions

Run

Used when Cmd+R. The executable specifies which app target to run

Screenshot 2019-12-14 at 23 39 48

Test

Used when Cmd+U. The tests specifies which test target to run

Screenshot 2019-12-14 at 23 40 09

Test target recognises app …

How to set language and locale with xcodebuild

Issue #540

testLanguage and testRegion

 -testLanguage language
       Specifies ISO 639-1 language during testing. This overrides the setting for the test action of a
       scheme in a workspace.

 -testRegion region
       Specifies ISO 3166-1 …

How to take screenshots for UITest in Xcodee

Issue #539

XCUIScreenshot

extension XCTestCase {
    func takeScreenshot(name: String) {
        let screenshot = XCUIScreen.main.screenshot()
        let attach = XCTAttachment(screenshot: screenshot)
        attach.lifetime = .keepAlways …

How to use Xcode

Issue #499

Build setting

Build Library For Distribution

It turns on all the features that are necessary to build your library in such a way that it can be distributed

What does this error actually mean? Well, when the …

Links for Xcode

Issue #499

Build setting

Build Library For Distribution

It turns on all the features that are necessary to build your library in such a way that it can be distributed

What does this error actually mean? Well, when the …

How to configure test target in Xcode

Issue #478

This applies to

  • Main targets
    • App
    • Framework
  • Test targets
    • Unit tests
    • UI tests

Examples

Dependencies used

Examples

  • Cocoapods
  • Carthage

Notes

  • Make sure test target can link to all the …

How to use Apple certificate in Xcode 11

Issue #458

For push notification, we can now use just Production Certificate for 2 environments (production and sandbox) instead of Development and Production certificates.

Now for code signing, with Xcode 11 …

How to run app on beta iOS devices

Issue #343

Xcode 10.3 with iOS 13

sudo ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/13.0 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport

Xcode 10.3 with iOS 13.1 …

How to convert your Xcode plugins to Xcode extensions

Issue #267

Original post https://medium.freecodecamp.org/how-to-convert-your-xcode-plugins-to-xcode-extensions-ac90f32ae0e3


Xcode is an indispensable IDE for iOS and macOS developers. From the early days, the ability to build and install custom …

How to fix UITargetAppPath should be provided in iOS tests

Issue #237

Go to test target, under Host Application, select another app target, and select the preferred app target again

What is Personal team in Xcode

Issue #215

https://developer.apple.com/library/archive/qa/qa1915/_index.html

Xcode 7 and Xcode 8 allow you to select the free personal team provided with your Apple ID for signing your app. This team allows you to build apps for your personal use on …

How to build with xcodebuild and automatic code signing

Issue #207

Team ID

Error

Message: "xcodebuild: error: invalid option '-teamID'

Use =

xcodebuild teamID=T78DK947F3

Does not work 😢

DEVELOPMENT_TEAM

https://pewpewthespells.com/blog/migrating_code_signing.html

xcodebuild DEVELOPMENT_TEAM= …

How to fix mismatched deployment between app and test target in Xcode

Issue #204

  • My macOS app target has deployment target 10.12, but when running test, I get
Compiling for OS X 10.11, but module 'MyApp' has a minimum deployment target of OS X 10.12: …

How to use shared AppGroup UserDefaults in macOS and Xcode extension

Issue #201

  • Go to both app and extension target, under Capabilities, enable AppGroup

  • Specify $(TeamIdentifierPrefix)group.com.onmyway133.MyApp

  • $(TeamIdentifierPrefix) will expand to something like T78DK947F3., with .

  • Then using is like a …

Using CircleCI 2.0

Issue #158

We ’ve been using CircleCI for many of our open source projects. Since the end of last year 2017, version 2.0 began to come out, and we think it’s good time to try it now together with Swift 4.1 and Xcode 9.3

The problem with …