How do I detect that an iOS app is running on a jailbroken phone?

Ben Gottlieb picture Ben Gottlieb · Jan 5, 2009 · Viewed 80.8k times · Source

If I want my app to behave differently on a jailbroken iPhone, how would I go about determining this?

Answer

wisequark picture wisequark · Jan 5, 2009

It depends what you mean by jailbreak. In the simple case, you should be able to see if Cydia is installed and go by that - something like

NSString *filePath = @"/Applications/Cydia.app";
if ([[NSFileManager defaultManager] fileExistsAtPath:filePath])
{
   // do something useful
}

For hacked kernels, it's a little (lot) more involved.