HOW TO - Use Safe Mode to maintain a stable jailbreak

HOW TO - Use Safe Mode to maintain a stable jailbreak

f4780y

Super Moderator
Thread Starter
Staff member
Joined
Apr 11, 2011
Messages
915
Reaction score
153
Location
Troon, Scotland
Welcome to the iPhoneForums.net how-to guide on using Safe Mode to help you maintain a stable jailbreak...

What is Safe Mode?
Safe Mode is a facility provided by Mobile Substrate, a core component of the jailbreak required by tweaks that need to hook into the operating system. Maobile Substrate provides integration services to the tweaks and also protects you from badly behaving tweaks via Safe Mode.
When safe mode is active on your iPhone, all tweaks which use Mobile Substrate are temporarily disabled to give you an opportunity to resolve any problems. Many inexperienced jailbreakers incorrectly blame Mobile Substrate for their device being in Safe Mode. As the text which appears when you are in safe mode explains, Mobile Substrate did not cause the problem, it protected you from it...

d35d11ec.jpg


You should never remove Mobile Substrate from your device unless you absolutely positively know what your are doing and why! Also, don't believe any of the ramblings you will find across the internet about Mobile Substrate causing severe battery drain or that you are best to downgrade to an older version. Typically, these are misinformed discussions by inexperienced users. You should always be running the latest version of Mobile Substrate unless you hear definitively that there is a problem with it. Even then, you can expect Saurik to pull the build from Cydia and replace it with a working one very quickly, and for the staff at iPhoneForums to let you know officially that there is a problem!

Automatic activation of Safe Mode.
From time to time you may find that your device resprings and safe mode is activated automatically. You will recognise this has happened because "Exit Safe Mode" will be visible in the status bar and a pop-up dialogue will appear explaining what has happened. You will also notice that because all JB tweaks have been temporarily disabled your springboard will look more like a stock device than a jailbroken one. Your icon layout is likely to be reset, icons may no longer be in the folders you expected, and the dock might be different (depending on how your device is customised).

What do I do?
First, don't panic! Safe mode is there to protect you and is not to be feared!

Sometimes, like any piece of software, a JB tweak can crash and trigger Mobile Substrate to offer Safe Mode protection. It is not necessarily a sign that there is something fundamentally wrong with your jailbreak. It's just that a tweak crashed. So the first thing to try is respringing by pressing the "Restart" button on the pop-up Safe Mode dialogue, If you already dismissed the dialogue, that's OK. You can call it up again at any time by tapping the status bar at the top of the screen where it says "Exit Safe Mode".

If your device resprings and everything looks normal again, then the crash which caused Safe Mode to be triggered was probably not too serious and "just one of those things". Apps do crash from time to time, particularly jailbreak tweaks which hook into the operating system. Just write it off to experience and continue to enjoy your JB!

However, if you immediately end up back in Safe Mode again, or you can perform some type of action which will consistently trigger Safe Mode, then you know you have a badly behaving tweak on your hands. 9 times out of 10 the culprit will be the last tweak you installed or updated. For this reason it is VERY IMPORTANT that you pay attention to the updates you apply via Cydia. If you don't know what it was you updated then you may have to go through everything on a trial and error basis until you find out what was wrong. First rule of Cydia - pay attention!

Removing badly behaving tweaks.
The main purpose of Safe Mode is to allow you to get into Cydia and remove a tweak or app which is causing problems. If you suddenly find yourself in a Safe Mode situation which you cannot get out of then chances are the last tweak or app which you installed or updated in Cydia is causing the problem. Open Cydia, switch to the "Manage" tab, choose "Packages", and remove the application(s) or tweak(s) which you recently installed or updated. Common culprits are older tweaks or apps which were designed for previous version of IOS. So maybe a 3.x tweak you are tying to run on a 5.x device. These often WONT work!
Once you have removed the appropriate tweaks and apps, respring the device. If you are back to your normally jailbroken state, then chances are you correctly identified the problem tweak. You may want to keep an eye on it, search our forum for information on it, or get in touch with the developer to ask about compatibility or known problems.

If you still end up in Safe Mode after removing the tweak you thought might be the problem, then you will need to carry on testing out other tweaks and apps until you find the culprit. This is typically trial and error, but you should always go on the basis of what was most recently installed. JB apps tend not to develop problems over time, they tend to have them from the outset so look at what has most recently changed.

Help! I can't even get into Safe Mode!
Sometimes a JB tweak can be so badly behaved that Mobile Substrate cannot or does not put the device into Safe Mode automatically. In these situations, a wise jailbreaker will ensure they have kept a back door open for triggering Safe Mode themselves. There are several alternative methods to ensure you can launch Safe Mode manually, but all of them need a little prior preparation, so the best advice is to do them NOW when you are not in need of Safe Mode rather than wait until your device is in a mess, when you may struggle to get Safe Mode activated... You have been warned! ;)

Safe Mode Launcher, PowerIcons, et. al.
A Cydia app which does exactly what it says on the tin! Installing this app will put an icon on your springboard which will enable Safe Mode for you. Very handy. Just be aware that sometimes, depending on the severity of the problems you are facing, you may not be able to even get to your springboard to launch this app if it is installed, so don't rely on it as your only protection... ;) There are several other similar apps in Cydia which provide icons for you to click to get into safe mode as well as other functions, such as a reboot, e.g the "PowerIcons" app. All of these should be considered in the same category. Very useful, but not always accessible, depending on the error you are encountering. The following screenie shows the icons installed by the free "PowerIcons" app:

3da1c79c.jpg


SBSettings.
Using SBSettings (normally from the lock screen) to get into Safe Mode is the most popular and easy way to get started with a basic level of protection. Make sure you allow SBSettings to be activated from the Lock Screen, bring it up with it's usual action (swipe across the status bar by default), choose the "Power" button on the right hand side, and choose "Safe Mode" from the pop-up menu. Your device will respring into Safe Mode.

009cad05.jpg


Activator.
Another popular method for the more savvy jailbreaker is to assign a specific Activator gesture to trigger Safe Mode when at the Lock Screen. This leaves you free to choose the gesture you prefer. Just don't forget what you assigned it to once you have configured the Activator app!

19908a21.jpg


SSH Command Line.
This is the favourite back-door for the hardcore jailbreaker. Sometime a tweak can be so badly misbehaving that the lock screen will not even appear and the device will hang at the Apple logo with a "spinning wheel of death".
Even in this state, a device with OpenSSH installed should be able to be contacted, either over WiFi or USB, to get to the command line. I tend to use Putty for this purpose. You can also use iFunBox.
The important pre-requisite for this is that you install OpenSSH, so get it installed now, and don't forget to change the default password!

Once you have a command line open to your device, the following command will trigger Safe Mode:

touch /var/mobile/Library/Preferences/com.saurik.mobilesubstrate.dat

I hope you found this guide useful! :)
 
Last edited:
Wow, super nice write up. As always thanks for sharing such of a great tips and your advises are always welcome!

Thanks! I will use some of this info on my freshly JB iOS 5 now :)
 
Here is a good sample for this... I loaded semitether update but after update the packages never finish loading well for some reason and I had to reboot. I had one issues after, all my apps open VERY small in the top left corner.

Solution:
I used SBSetting to reboot on Safe Mode and was able to reinstall the semitether package and life was good again! :-)

Thanks again Leigh!
 
Here is a good sample for this... I loaded semitether update but after update the packages never finish loading well for some reason and I had to reboot. I had one issues after, all my apps open VERY small in the top left corner.

Solution:
I used SBSetting to reboot on Safe Mode and was able to reinstall the semitether package and life was good again! :-)

Thanks again Leigh!

You're welcome Ernie.
 

Latest posts

Back
Top