Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save erneestoc/7624f5b517915b229dc867c87aad0406 to your computer and use it in GitHub Desktop.

Select an option

Save erneestoc/7624f5b517915b229dc867c87aad0406 to your computer and use it in GitHub Desktop.

Revisions

  1. @ddunbar ddunbar revised this gist Apr 29, 2018. 1 changed file with 0 additions and 3 deletions.
    3 changes: 0 additions & 3 deletions xcbuild-debugging-tricks.md
    Original file line number Diff line number Diff line change
    @@ -4,9 +4,6 @@

    ```shell

    # enable internal menu
    defaults write com.apple.dt.Xcode ShowDVTDebugMenu -bool YES

    alias xcbuild=$(xcode-select -p)/../SharedFrameworks/XCBuild.framework/Versions/A/Support/xcbuild
    # THIS DOESNT WORK YET: xcbuild openIDEConsole # … then switch to Xcode ➡️
    xcbuild showSpecs
  2. @ddunbar ddunbar revised this gist Nov 2, 2017. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions xcbuild-debugging-tricks.md
    Original file line number Diff line number Diff line change
    @@ -17,6 +17,8 @@ defaults write com.apple.dt.XCBuild EnableDebugActivityLogs -bool YES

    # Enable build debugging mode (safe to leave on, but slows down the build system & litters DerivedData/<project>/Build/Intermediates.noindex), generally should only be enabled when trying to capture a trace for incremental build debugging purposes.
    defaults write com.apple.dt.XCBuild EnableBuildDebugging -bool YES
    # You can also use:
    env EnableBuildDebugging=YES xcodebuild -UseNewBuildSystem=1 ...

    # Use `xcbuild` to dump a headermap.
    xcbuild headermap --dump <path>
  3. @ddunbar ddunbar revised this gist Jul 17, 2017. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions xcbuild-debugging-tricks.md
    Original file line number Diff line number Diff line change
    @@ -17,6 +17,9 @@ defaults write com.apple.dt.XCBuild EnableDebugActivityLogs -bool YES

    # Enable build debugging mode (safe to leave on, but slows down the build system & litters DerivedData/<project>/Build/Intermediates.noindex), generally should only be enabled when trying to capture a trace for incremental build debugging purposes.
    defaults write com.apple.dt.XCBuild EnableBuildDebugging -bool YES

    # Use `xcbuild` to dump a headermap.
    xcbuild headermap --dump <path>
    ```


  4. @ddunbar ddunbar revised this gist Jun 15, 2017. 1 changed file with 5 additions and 2 deletions.
    7 changes: 5 additions & 2 deletions xcbuild-debugging-tricks.md
    Original file line number Diff line number Diff line change
    @@ -14,6 +14,9 @@ xcbuild build <foo.pif> [—target <target>]

    # Some minimal additional logging (this is safe to leave on).
    defaults write com.apple.dt.XCBuild EnableDebugActivityLogs -bool YES

    # Enable build debugging mode (safe to leave on, but slows down the build system & litters DerivedData/<project>/Build/Intermediates.noindex), generally should only be enabled when trying to capture a trace for incremental build debugging purposes.
    defaults write com.apple.dt.XCBuild EnableBuildDebugging -bool YES
    ```


    @@ -23,9 +26,9 @@ open with Internal > XCBuild Console

    ```shell
    writePIF <workspace name> <path>
    # … you can use this with the `xcbuild build …` command to build via the service directly
    # … you can use this with the `xcbuild build …` command (above) to build via the service directly
    showStatistics
    clearAllCaches
    setConfig EnableBuildDebugging true
    # … then save DerivedData & build log
    # … then save DerivedData & build log; same as above dwrite, but not persisted
    ```
  5. @ddunbar ddunbar revised this gist Jun 15, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion xcbuild-debugging-tricks.md
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@
    ```shell

    # enable internal menu
    defaults write com.apple.dt.Xcode ShowDVTDebugMenu -book YES
    defaults write com.apple.dt.Xcode ShowDVTDebugMenu -bool YES

    alias xcbuild=$(xcode-select -p)/../SharedFrameworks/XCBuild.framework/Versions/A/Support/xcbuild
    # THIS DOESNT WORK YET: xcbuild openIDEConsole # … then switch to Xcode ➡️
  6. @ddunbar ddunbar revised this gist Jun 15, 2017. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions xcbuild-debugging-tricks.md
    Original file line number Diff line number Diff line change
    @@ -11,8 +11,12 @@ alias xcbuild=$(xcode-select -p)/../SharedFrameworks/XCBuild.framework/Versions/
    # THIS DOESNT WORK YET: xcbuild openIDEConsole # … then switch to Xcode ➡️
    xcbuild showSpecs
    xcbuild build <foo.pif> [—target <target>]

    # Some minimal additional logging (this is safe to leave on).
    defaults write com.apple.dt.XCBuild EnableDebugActivityLogs -bool YES
    ```


    ## IDE Console

    open with Internal > XCBuild Console
  7. @ddunbar ddunbar revised this gist Jun 9, 2017. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions xcbuild-debugging-tricks.md
    Original file line number Diff line number Diff line change
    @@ -19,6 +19,7 @@ open with Internal > XCBuild Console

    ```shell
    writePIF <workspace name> <path>
    # … you can use this with the `xcbuild build …` command to build via the service directly
    showStatistics
    clearAllCaches
    setConfig EnableBuildDebugging true
  8. @ddunbar ddunbar revised this gist Jun 9, 2017. 1 changed file with 8 additions and 1 deletion.
    9 changes: 8 additions & 1 deletion xcbuild-debugging-tricks.md
    Original file line number Diff line number Diff line change
    @@ -1,15 +1,22 @@
    # New Build System Tricks
    ## Command Line


    ```shell

    # enable internal menu
    defaults write com.apple.dt.Xcode ShowDVTDebugMenu -book YES

    alias xcbuild=$(xcode-select -p)/../SharedFrameworks/XCBuild.framework/Versions/A/Support/xcbuild
    xcbuild openIDEConsole # … then switch to Xcode ➡️
    # THIS DOESNT WORK YET: xcbuild openIDEConsole # … then switch to Xcode ➡️
    xcbuild showSpecs
    xcbuild build <foo.pif> [—target <target>]
    ```

    ## IDE Console

    open with Internal > XCBuild Console

    ```shell
    writePIF <workspace name> <path>
    showStatistics
  9. @ddunbar ddunbar created this gist Jun 6, 2017.
    19 changes: 19 additions & 0 deletions xcbuild-debugging-tricks.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    # New Build System Tricks
    ## Command Line

    ```shell
    alias xcbuild=$(xcode-select -p)/../SharedFrameworks/XCBuild.framework/Versions/A/Support/xcbuild
    xcbuild openIDEConsole # … then switch to Xcode ➡️
    xcbuild showSpecs
    xcbuild build <foo.pif> [—target <target>]
    ```

    ## IDE Console

    ```shell
    writePIF <workspace name> <path>
    showStatistics
    clearAllCaches
    setConfig EnableBuildDebugging true
    # … then save DerivedData & build log
    ```