Finding Dependency Cycles in iOS Builds with llbuild UI

Did you know the swift-llbuild project contains a debugging tool called llbuild-ui that can find dependency cycles in your iOS build? To try it:

  1. Enable the New Build System (In Xcode it’s under File, Workspace Settings)
  2. Build your project
  3. Open the Derived Data directory on your machine and find the build.db file generated by the build system. This will be in a path similar to /Users/<yourUsername>/Library/Developer/Xcode/DerivedData/iOS-<someIdentifier>/Build/Intermediates.noindex/XCBuildData/build.db. Take note of this path as you will need it later.
  4. Follow the instructions here to install llbuild UI. You’ll need to have Python (and probably some dependencies) installed on your system.
  5. Start llbuild UI by running the command shown on the Github page linked in step 4 above in terminal. venv/bin/python -m flask run

  6. Visit in your browser. You should see something like this:

    Screen Shot 2018-04-03 at 10.57.17 AM.png

  7. Click on Database Browser, which will show you the database configuration screen:

    Screen Shot 2018-04-03 at 11.00.44 AM.png

  8. Paste the path from step 2 above into the field and click “Set Path”

  9. Wait until the page refreshes then change the address in your browser’s address bar to Any cycles found in your build should be shown on screen.


Now read this

GCD: Using Dispatch Groups for Fun and Profit

I’m republishing this article here so I can reference it later. I recently needed a way to perform an unknown number of asynchronous http requests and wait until they were all done before proceeding. dispatch_groups are a neat feature of... Continue →