Dev:Updating extensions for iOS 10

From The Apple Wiki

Let's collect knowledge like we did with iOS 9, iOS 8 and iOS 7 – paste in your notes and share what you've learned, and somebody else will organize it later. :) If you want to ask questions and share tips over chat with other developers, see How to use IRC for how to connect to #theos and #iphonedev.

It's also helpful to double-check the statements here and add more info! These are notes and drafts from early research – feel free to update them.

What has changed in iOS 10? (Classes, frameworks, etc.)


For now you will need RocketBootStrap from


The system logging APIs have changed again – ASL and syslog are now deprecated in favor of the unified logging system. NSLog() and CFLog() now send their output through this system.

The Console app in macOS Sierra supports reading logs from connected iOS devices – just select the device from the sidebar. The new concept seems to encourage being verbose, so system processes have become pretty noisy. Right-click a message to reveal options for filtering to or filtering out messages from a process, library, subsystem, category, etc. You probably want to filter out irrelevant noisy processes otherwise you’ll be overwhelmed and need to scroll a lot. Set up a filter you’re happy with and click Save in the top-right. There is also the log command line tool.

Keep in mind the APIs are new to iOS 10. If you support older iOS, retrieve the function symbols at runtime with dlsym() and fall back to an old logging mechanism if they are null.

Logging using OSLog

NSLog/printf no longer prints to the system log. You must now use OSLog to display output on the console.

In order to use OSLog, you must compile your tweak using the iOS 10 SDK (or later).

In your makefile:


To use OSLog:

#import <os/log.h>    



In iOS 9 and applications dynamic and shortcut items were accessed view dynamicShortcutItems and staticShortcutItems. These have now been changed to dynamicApplicationShortcutItems and staticApplicationShortcutItems.


You used to be able to manually create a shortcut item and activate it using _activateShortcutItem:fromApplication:. This has been removed.


The iOS 10 lockscreen presents subclasses of SBDashBoardPageViewController as pages for the user to swipe through; new pages can be added with ease.


OpenSSH is broken on iOS 10, which is why yalu comes with dropbear (an alternative ssh server). To SSH into your device after jailbreaking, you have to do it via USB

If you accidentally install the openssh package (BigBoss Tools includes it for example), simply remove the openssh package, reboot and rejailbreak.

If you get this error with scp:

sh: scp: command not found
lost connection

Download iosbinpack, then copy it over like so:

ssh phone 'cat > /usr/bin/scp' < ~/Downloads/iosbinpack64/usr/bin/scp

Then on the phone, chmod +x /usr/bin/scp.

Tweak simply not loading

If your tweak (or preference bundle) does not load, you might have these lines in your Makefile that you need to remove:

TweakName_LDFLAGS += -Wl,-segalign,4000

See Updating extensions for iOS 9#Compilation changes for an explanation.

Simulating button presses

If your tweak relied on these method _menuButtonDown:/Up: (iOS 7+) or menuButtonDown:/Up: (iOS 6-) those will no longer work. A few alternatives are:

In the SpringBoard class you can call these

- (void)_simulateLockButtonPress;
- (void)_simulateHomeButtonPress;

If you need to do a double press you can use the new class SBHomeHardwareButton which has a few methods to use. One that works well with the older methods is

- (BOOL)emulateHomeButtonEventsIfNeeded:(IOHIDEventRef)arg1 ; // IOS 10

This method takes the same parameter as the older methods to it is easy to use it:

uint64_t abTime = mach_absolute_time();
IOHIDEventRef event = IOHIDEventCreateKeyboardEvent(kCFAllocatorDefault, *(AbsoluteTime *)&abTime, 0xC, 0x40, YES, 0);
[[[UIApplication sharedApplication] homeHardwareButton] emulateHomeButtonEventsIfNeeded:event];

The SpringBoard class has a @property for the new "hardware" button like so:

@property (nonatomic,readonly) SBHomeHardwareButton * homeHardwareButton; // IOS 10

Both _simulateHomeButtonPress and emulateHomeButtonEventsIfNeeded don't simulate Home button fully, for example, you can't take screenshot, or call Siri by those methods.

Reacting to home button presses

Before iOS 10, we can use this

%hook SpringBoard

- (void)_handleMenuButtonEvent{


However in iOS 10 it no longer works. Instead, we can use methods present in the SBHomeHardwareButton class. These also seem to work if pressing 'home' on AssistiveTouch.

%hook SBHomeHardwareButton

- (void)initialButtonDown:(id)arg1 { ... }
- (void)initialButtonUp:(id)arg1 { ... }
- (void)doublePressDown:(id)arg1 { ... }
- (void)doublePressUp:(id)arg1 { ... }
- (void)triplePressUp:(id)arg1 { ... }
- (void)doubleTapUp:(id)arg1 { ... }
- (void)singlePressUp:(id)arg1 { ... }
- (void)_singlePressUp:(id)arg1 { ... } // _?


You can hook them all to see which ones are called when. There is also SBHomeHardwareButtonActions which may be of interest.