1. Using the Filesystem
All methods presented in this point can be easily detected (it is very easy to find appropriate string in the application) and can be very easily bypassed (simple file name change can bypass this detection).
Existence of file
Size of /etc/fstab file
The size of the file can be changed when new updates are installed.
Read/Write permission to the root partition
Existence of symbolic links
2. API Calls detection
Appropriate implementation can be very difficult to detect and bypassed.
vm_protect() - obsolete
3. Services detectionThe jailbroken device mainly runs some services. The can be check in order to detect if device is jailbroken.
This method can be very time consuming (if ssh is not installed, the connection must be timeout). It is also very easy to bypass by changing the port for the OpenSSH service.
4. Scheme detectionIt is difficult to change scheme for the iOS however the Cydia can be removed during the testing process.
If calling the Cydia’s URL scheme (cydia://) from your application gives a success, you can be sure that the device is jailbroken.