I'm trying to call a function on ptrace
like thisptrace(PT_DENY_ATTACH, 0, 0, 0);
But when I try to import it using #include <sys/ptrace.h>
Xcode gives me an error 'sys/ptrace.h' file not found
. Am I missing something, do I need to import a library or is this simply unavailable on iOS?
相关问题
- Loading local file in WKWebView doesn't workin
-
“
” error when running pip or venv - Swift UIApplication.setStatusBarStyle Doesn't
- rtsp:// liveStream with AVPlayer
- Xcode 6 GM with iPhone 5s (iOS 8 GM) - 0xE8000070
相关文章
- Navigation bar disappears when typing in UISearchC
- iOS 8 Today widget alignment issue
- Using the device simulator for iOS 8 with Xcode 7
- Using UILexicon to implement autocorrect in iOS 8
- Can't see custom keyboard in Safari of iOS8.1
- Can't use Swift classes inside Objective-C uni
- Open local PDF file in iBooks
- NSExtension Share Extension limit Photos count
The problem here is that Xcode is prepending its SDK base path to all system header paths (e.g., /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/usr/include/). Unfortunately, ptrace.h is not there but is found in /usr/include/sys/. So, to solve this, you need to change your include statement to be:
I have no idea why ptrace.h is not included in the SDK but the functionality you're looking for does work when it's running on the phone.
Update: While this does allow you to use the ptrace functionality, uploading to Apple will result in app rejection due to:
This seems to be working for me and will prevent attaching the debugger. I have not tested the #ifdef OPTIMIZE if it works in distribution, so let me know if you find any problems.