Installed-Size: %S
 Maintainer: Jay Freeman (saurik) <saurik@saurik.com>
 Architecture: iphoneos-arm
-Version: 1.0.3162-1
+Version: 1.0.3198-1
 Description: UIKit/GraphicsServices command line access
 Name: UIKit Tools
 Author: Jay Freeman (saurik) <saurik@saurik.com>
 
-uikittools = uiduid uishoot uicache uiopen gssc
+uikittools = uiduid uishoot uicache uiopen gssc sbdidlaunch
 
 all: $(uikittools)
 
 .PHONY: all clean package
 
 %: %.mm
-       $${PKG_TARG}-g++ -o $@ $< -framework CoreFoundation -framework Foundation -framework UIKit -framework GraphicsServices -F"$${PKG_ROOT}"/System/Library/PrivateFrameworks -lobjc
+       $${PKG_TARG}-g++ -o $@ $< -framework CoreFoundation -framework Foundation -framework UIKit -framework GraphicsServices -F"$${PKG_ROOT}"/System/Library/PrivateFrameworks -lobjc -framework SpringBoardServices
        ldid -S $@
 
 package: all
 
--- /dev/null
+#import <CoreFoundation/CoreFoundation.h>
+
+extern "C" void *SBSSpringBoardServerPort();
+
+void OnDidLaunch(
+    CFNotificationCenterRef center,
+    void *observer,
+    CFStringRef name,
+    const void *object,
+    CFDictionaryRef info
+) {
+    CFRunLoopStop(CFRunLoopGetCurrent());
+}
+
+int main() {
+    CFNotificationCenterAddObserver(
+        CFNotificationCenterGetDarwinNotifyCenter(),
+        NULL,
+        &OnDidLaunch,
+        CFSTR("SBSpringBoardDidLaunchNotification"),
+        NULL,
+        NULL
+    );
+
+    if (SBSSpringBoardServerPort() == NULL)
+        CFRunLoopRun();
+
+    return 0;
+}