The key to determining whether an app can be debugged is the compiled code sign entitlements.
You only need to add the following fields in entitlement:
<Key> Get-task-Allow </key>
<True/>
The execution file can be debugged.
The modification method is as follows:
1. Copy the debug execution file to Mac.
2. Use the ldid tool to export its Code Sign
Ldid-e helloworld> helloworld.txt
3. modify the code sign and add the above fields.
4. re-align and Code Sign
Ldid -shelloworld.txt./helloworld
5. copy back to the device and change the permission to 755.
Chmod 755./helloworld
6. Open xcode-> product-> attach to process-> by process PID and enter helloworld.
StartProgramThen the Debugging starts automatically.
Of course, this method is suitable for jailbreaking devices, because in this way, you can grant permissions to them.
The app must also be a version not released through the Apple store, because Apple will encrypt the signature of each app.
In the future, we will explain how to debug encrypted devices.