Last active
August 29, 2025 19:44
-
-
Save leviathan/0c806022cd83d0a51a15c92b6b53db49 to your computer and use it in GitHub Desktop.
Revisions
-
leviathan revised this gist
Mar 22, 2022 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -31,6 +31,11 @@ The builds duration appears after a build, alongside with the “Succeeded” me  #### Xcode build timing summary Run Xcode Build Timing Summary to get build time insights and find bottlenecks - run it via: `Product => Perform Action => Build With Timing Summary`.  ### Swift Package Manager -
leviathan revised this gist
Mar 22, 2022 . 1 changed file with 9 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,11 +14,19 @@ pkgutil --pkg-info=com.apple.pkg.CLTools_Executables | grep version // Check X ### Measuring Xcode build time #### Xcode build report We can get the build time easily via Xcode. It keeps track of all your builds by default and you can examine the times and logs from the Report Navigator.  Duration appears in the activity viewer after a build, alongside the "Succeeded" message. If you are running the app, the status will be replaced by the running status before you can see the duration. ```terminal $> defaults write com.apple.dt.Xcode ShowBuildOperationDuration YES ``` The builds duration appears after a build, alongside with the “Succeeded” message.  -
leviathan revised this gist
Mar 22, 2022 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,6 +12,8 @@ pkgutil --pkg-info=com.apple.pkg.CLTools_Executables | grep version // Check X ## Xcode tips ### Measuring Xcode build time Duration appears in the activity viewer after a build, alongside the "Succeeded" message. If you are running the app, the status will be replaced by the running status before you can see the duration. ``` -
leviathan revised this gist
Mar 22, 2022 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -19,6 +19,7 @@ $> defaults write com.apple.dt.Xcode ShowBuildOperationDuration YES ``` The builds duration appears after a build, alongside with the “Succeeded” message.  -
leviathan revised this gist
Mar 22, 2022 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -20,6 +20,8 @@ $> defaults write com.apple.dt.Xcode ShowBuildOperationDuration YES The builds duration appears after a build, alongside with the “Succeeded” message. ### Swift Package Manager 1. `~/Library/Caches/org.swift.swiftpm/repositories` => Delete package folder and lock file -
leviathan revised this gist
Mar 22, 2022 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -17,6 +17,8 @@ If you are running the app, the status will be replaced by the running status be ``` $> defaults write com.apple.dt.Xcode ShowBuildOperationDuration YES ``` The builds duration appears after a build, alongside with the “Succeeded” message. ### Swift Package Manager -
leviathan revised this gist
Mar 22, 2022 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,7 +14,9 @@ pkgutil --pkg-info=com.apple.pkg.CLTools_Executables | grep version // Check X Duration appears in the activity viewer after a build, alongside the "Succeeded" message. If you are running the app, the status will be replaced by the running status before you can see the duration. ``` $> defaults write com.apple.dt.Xcode ShowBuildOperationDuration YES ``` ### Swift Package Manager -
leviathan revised this gist
Mar 22, 2022 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,6 +10,12 @@ pkgutil --pkg-info=com.apple.pkg.CLTools_Executables | grep version // Check X ## MacOSX Xcode ## Xcode tips Duration appears in the activity viewer after a build, alongside the "Succeeded" message. If you are running the app, the status will be replaced by the running status before you can see the duration. `$> defaults write com.apple.dt.Xcode ShowBuildOperationDuration YES` ### Swift Package Manager 1. `~/Library/Caches/org.swift.swiftpm/repositories` => Delete package folder and lock file -
leviathan revised this gist
Oct 20, 2021 . 1 changed file with 7 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,6 +8,13 @@ swift build --version pkgutil --pkg-info=com.apple.pkg.CLTools_Executables | grep version // Check Xcode Command-Line-Tools Version ``` ## MacOSX Xcode ### Swift Package Manager 1. `~/Library/Caches/org.swift.swiftpm/repositories` => Delete package folder and lock file 2. in Xcode, run `File -> Swift Packages -> Reset Package Caches` ## xcode-select **version** -
leviathan revised this gist
Sep 29, 2021 . 1 changed file with 32 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -103,4 +103,35 @@ Get the list in structured format: $ xcrun simctl list --json ``` Reference: https://nshipster.com/simctl/ ## Custom toolchain from the command line When using `xcodebuild` or ie. `Fastlane` to build your project, it will use the default swift toolchain (the one from the currently selected Xcode). You can check currently selected toolchain with this command: ``` $> swift --version Apple Swift version 5.1.3 (swiftlang-1100.0.282.1 clang-1100.0.33.15) Target: x86_64-apple-darwin19.3.0 ``` To use the alternative toolchain you can run `xcrun` and `xcodebuild` with a `-toolchain` flag like this: ``` xcodebuild -toolchain NAME xcrun --toolchain NAME ``` where `NAME` is either an identifier or name of the toolchain, ie. `xcodebuild --toolchain swift`. You could also export it to your current terminal session with a command: ``` $> export TOOLCHAINS=swift $> export TOOLCHAINS=org.swift.51220191130a // /Library/Developer/Toolchains/swift-5.1.2-RELEASE.xctoolchain/Info.plist => CFBundleIdentifier ``` ## Carthage Run carthage with a specific swift toolchain: ``` carthage update --toolchain org.swift.402017072a ``` -
leviathan revised this gist
Sep 29, 2021 . 1 changed file with 1 addition and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -28,8 +28,7 @@ foo@bar:~$ xcode-select -p $ xcode-select -s/--switch /Library/Developer/CommandLineTools/ ``` **Re-Install Command line tools** => This will download and install the lastest CLT version from Apple and install it. ```console $> sudo rm -rf /Library/Developer/CommandLineTools -
leviathan revised this gist
Sep 29, 2021 . 1 changed file with 33 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,17 +8,48 @@ swift build --version pkgutil --pkg-info=com.apple.pkg.CLTools_Executables | grep version // Check Xcode Command-Line-Tools Version ``` ## xcode-select **version** ```console foo@bar:~$ xcodebuild -version Xcode 10.1 Build version 10B61 ``` **Check the currently selected directory.** ```console foo@bar:~$ xcode-select -p /Applications/Xcode_10.1.app/Contents/Developer ``` **Select Command line tools:** ```console $ xcode-select -s/--switch /Library/Developer/CommandLineTools/ ``` h4. Re-Install Command line tools => This will download and install the lastest CLT version from Apple and install it. ```console $> sudo rm -rf /Library/Developer/CommandLineTools $> xcode-select --install ``` => If older CLT version is needed, then uninstall current version & download PKG from [Apple Downloads](https://developer.apple.com/download/all/) ## xcrun **Get help** ``` $ xcrun simctl help usage: simctl [--set <path>] [--profiles <path>] <subcommand> ... simctl help [subcommand] Command line utility to control the Simulator ``` **Run the list subcommand to get a list of the available runtimes, device types, devices, and device pairs:** ``` $ xcrun simctl list -- iOS 12.1 -- -
leviathan revised this gist
Aug 5, 2021 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,6 +5,7 @@ xcode-select --print-path xcodebuild -version swift --version swift build --version pkgutil --pkg-info=com.apple.pkg.CLTools_Executables | grep version // Check Xcode Command-Line-Tools Version ``` ## xcrun -
leviathan revised this gist
Jul 21, 2021 . 1 changed file with 9 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,12 @@ ## Environment Info ``` xcode-select --print-path xcodebuild -version swift --version swift build --version ``` ## xcrun Get help -
leviathan revised this gist
Jul 19, 2021 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -46,6 +46,9 @@ $ xcrun simctl delete unavailable ``` $ xcrun simctl openurl booted "http://google.com" // open app url $ xcrun simctl openurl booted "ios-cobi://bike.cobi/app?state=w4BZrykXl7..." ``` // Print the UUID of the device in your simulator -
leviathan revised this gist
Jan 20, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ Get help ``` $ xcrun simctl help usage: simctl [--set <path>] [--profiles <path>] <subcommand> ... simctl help [subcommand] Command line utility to control the Simulator -
leviathan revised this gist
Jan 20, 2020 . 1 changed file with 8 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,13 @@ ## xcrun Get help ``` xcrun simctl help usage: simctl [--set <path>] [--profiles <path>] <subcommand> ... simctl help [subcommand] Command line utility to control the Simulator ``` Run the list subcommand to get a list of the available runtimes, device types, devices, and device pairs: ``` $ xcrun simctl list -
leviathan revised this gist
Jan 20, 2020 . 1 changed file with 31 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,11 +1,35 @@ ## xcrun Run the list subcommand to get a list of the available runtimes, device types, devices, and device pairs: ``` $ xcrun simctl list -- iOS 12.1 -- iPhone 5s (CC96B643-067E-41D5-B497-1AFD7B3D0A13) (Shutdown) iPhone 6 (7A27C0B9-411A-4BCD-8A67-68F00DF39C1A) (Shutdown) iPhone 6 Plus (A5918644-8D46-4C67-B21E-68EA25997F91) (Shutdown) iPhone 6s (1AB5A4EB-2434-42E4-9D2C-42E479CE8BDC) (Shutdown) … ``` One such subcommand is `boot`, which starts up the specified device, making it available for interaction: ``` $ xcrun simctl boot $UUID ``` ``` $ xcrun simctl shutdown $UUID $ xcrun simctl erase $UUID ``` // Removes old simulators, which xcode no longer uses ``` $ xcrun simctl delete unavailable ``` ### Opening URLs in Simulator // xcrun allows you to invoke developer tools from the terminal. // In this case simctl, which is a command line utility to control the iOS Simulator. // simctl has the subcommand: openurl to open URLs in a given simulator @@ -20,5 +44,12 @@ $ xcrun simctl openurl booted "http://google.com" ``` $ xcrun simctl list | egrep '(Booted)' iPhone X (9FED67A2-3D0A-4C9C-88AC-28A9CCA44C60) (Booted) ``` Get the list in structured format: ``` $ xcrun simctl list --json ``` Reference: https://nshipster.com/simctl/ -
leviathan revised this gist
Jan 20, 2020 . 1 changed file with 6 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,18 +1,23 @@ ## xcrun // Removes old simulators, which xcode no longer uses ``` $ xcrun simctl delete unavailable ``` // xcrun allows you to invoke developer tools from the terminal. // In this case simctl, which is a command line utility to control the iOS Simulator. // simctl has the subcommand: openurl to open URLs in a given simulator // most of the cases you would like to open on the current booted device, so you add // the flag booted or type the simulator id. ``` $ xcrun simctl openurl booted "http://google.com" ``` // Print the UUID of the device in your simulator ``` $ xcrun simctl list | egrep '(Booted)' ``` -
leviathan renamed this gist
Jan 20, 2020 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,13 +1,19 @@ // Removes old simulators, which xcode no longer uses ``` $ xcrun simctl delete unavailable ``` // xcrun allows you to invoke developer tools from the terminal. // In this case simctl, which is a command line utility to control the iOS Simulator. // simctl has the subcommand: openurl to open URLs in a given simulator // most of the cases you would like to open on the current booted device, so you add // the flag booted or type the simulator id. ``` $ xcrun simctl openurl booted "http://google.com" ``` // Print the UUID of the device in your simulator ``` $ xcrun simctl list | egrep '(Booted)' ``` -
leviathan revised this gist
Nov 24, 2019 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,3 +8,6 @@ $ xcrun simctl delete unavailable // the flag booted or type the simulator id. $ xcrun simctl openurl booted "http://google.com" // Print the UUID of the device in your simulator $ xcrun simctl list | egrep '(Booted)' -
leviathan revised this gist
Apr 17, 2018 . No changes.There are no files selected for viewing
-
leviathan revised this gist
Apr 17, 2018 . 1 changed file with 7 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,10 @@ // Removes old simulators, which xcode no longer uses $ xcrun simctl delete unavailable // xcrun allows you to invoke developer tools from the terminal. // In this case simctl, which is a command line utility to control the iOS Simulator. // simctl has the subcommand: openurl to open URLs in a given simulator // most of the cases you would like to open on the current booted device, so you add // the flag booted or type the simulator id. $ xcrun simctl openurl booted "http://google.com" -
leviathan revised this gist
Apr 16, 2018 . 1 changed file with 4 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,2 +1,5 @@ // Removes old simulators, which xcode no longer uses $ xcrun simctl delete unavailable // Open the provided URL in the currently booted simulator $ xcrun simctl openurl booted http://google.com -
leviathan revised this gist
Apr 16, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,2 +1,2 @@ #### removes old simulators, which xcode no longer uses $ xcrun simctl delete unavailable -
leviathan renamed this gist
Nov 3, 2017 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
leviathan renamed this gist
Nov 3, 2017 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
leviathan renamed this gist
Nov 3, 2017 . 1 changed file with 0 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,2 @@ // removes old simulators, which xcode no longer uses $ xcrun simctl delete unavailable -
leviathan revised this gist
Nov 3, 2017 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,2 +1,4 @@ ``` // removes old simulators, which xcode no longer uses $ xcrun simctl delete unavailable ``` -
leviathan created this gist
Nov 3, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,2 @@ // removes old simulators, which xcode no longer uses $ xcrun simctl delete unavailable