Skip to content

Instantly share code, notes, and snippets.

@florianbuerger
Last active August 29, 2015 14:22
Show Gist options
  • Save florianbuerger/42edd0e73f598cb9725b to your computer and use it in GitHub Desktop.
Save florianbuerger/42edd0e73f598cb9725b to your computer and use it in GitHub Desktop.
Detect synchronous network calls on the main thread with a breakpoint. Thanks to Cédric Luthi (https://twitter.com/0xced/status/421285255086346240)

Copy above file to .xcodeproj/xcshareddata/xcdebugger. Perfect sound to play: Torture

Again, thanks to @0xced!

<?xml version="1.0" encoding="UTF-8"?>
<Bucket
type = "4"
version = "2.0">
<Breakpoints>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.SymbolicBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
condition = "(BOOL)[NSThread isMainThread]"
continueAfterRunningActions = "No"
symbolName = "+[NSURLConnection sendSynchronousRequest:returningResponse:error:]"
moduleName = "">
<Actions>
<BreakpointActionProxy
ActionExtensionID = "Xcode.BreakpointAction.Log">
<ActionContent
message = "&#x26a0;&#xfe0f;&#x26a0;&#xfe0f;&#x26a0;&#xfe0f; WARNING: synchronous NSURLConnection on main thread"
conveyanceType = "0">
</ActionContent>
</BreakpointActionProxy>
<BreakpointActionProxy
ActionExtensionID = "Xcode.BreakpointAction.Sound">
<ActionContent
soundName = "torture">
</ActionContent>
</BreakpointActionProxy>
</Actions>
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment