Ios9屏蔽了sysctl方法,现在有什么办法可以获取进程呢?

现在有个需求需要监听别的App运行的时间,之前用了sysctl方法可以获取所有进程信息,现在被屏蔽了,实现想不出用什么办法了!!泡了几天论坛,发现用私有FBProcessManager这个类能获取,但是初始化的时候就报这个错 Terminating app due to uncaught exception ‘NSInternalInconsistencyException’, reason: ‘FBApplicationLibrary cannot be initialized before calling FBSystemAppMain()’

跪求各位 大神能通过什么方法获取!!

1 个赞

解决了没有? QQ:605157402 一起探讨下

没有。。。

我暂时用 IOKIT 能检测到进程是否运行 自己开定时器去扫描计时了 我没有找到其他好方法

IOKIT是什么?能检测到进程正在运行吗?

可以参考 GitHub - matthiasgasser/IOKitBrowser: Hardware Browser for iOS

谢谢 我去研究研究

跑了起来 好像没看到进程信息呢 请问你是如何检测到进程的?

ROOT > NxxAP >IOResources > IOCoreSurfaceROOT > IOSurfaceRootUserClient 每个节点下有运行的进程名字

1 个赞

终于找到了。。问你个问题 应用跳转出了设置URL Schemes打开应用的方法还能有什么方法做到跳转呢?

为什么有些app的进程能扫出来 有些不行呢 有遇到这个问题吗?

微信的进程都看不到

既然是IOKit ,我推断目标app必须要有IO动作才会被这个IOKit扫出来。拿一个空壳APP做测试,发现:
1。进行写文件操作。 结果 : 扫不出。
2。进行读文件操作。 结果 : 扫不出。
3。加载一个webview。 结果 : 扫出。
4。加载一个UIImageView并赋上图。 结果 : 扫出。

是不是只能检测到安装的程序,如果是用真机测试的时候直接跑的程序,貌似检测不到

Ld /Users/dandan/Library/Developer/Xcode/DerivedData/TestApp-bbhxnhaquqalsidiobfrmkywvapp/Build/Products/Debug-iphoneos/TestApp.app/TestApp normal armv7
cd /Users/dandan/Desktop/TestApp
export IPHONEOS_DEPLOYMENT_TARGET=9.1
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.1.sdk -L/Users/dandan/Library/Developer/Xcode/DerivedData/TestApp-bbhxnhaquqalsidiobfrmkywvapp/Build/Products/Debug-iphoneos -F/Users/dandan/Library/Developer/Xcode/DerivedData/TestApp-bbhxnhaquqalsidiobfrmkywvapp/Build/Products/Debug-iphoneos -filelist /Users/dandan/Library/Developer/Xcode/DerivedData/TestApp-bbhxnhaquqalsidiobfrmkywvapp/Build/Intermediates/TestApp.build/Debug-iphoneos/TestApp.build/Objects-normal/armv7/TestApp.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -miphoneos-version-min=9.1 -dead_strip -fembed-bitcode-marker -fobjc-arc -fobjc-link-runtime -Xlinker -dependency_info -Xlinker /Users/dandan/Library/Developer/Xcode/DerivedData/TestApp-bbhxnhaquqalsidiobfrmkywvapp/Build/Intermediates/TestApp.build/Debug-iphoneos/TestApp.build/Objects-normal/armv7/TestApp_dependency_info.dat -o /Users/dandan/Library/Developer/Xcode/DerivedData/TestApp-bbhxnhaquqalsidiobfrmkywvapp/Build/Products/Debug-iphoneos/TestApp.app/TestApp

Undefined symbols for architecture armv7:
“_IORegistryEntryGetNameInPlane”, referenced from:
-[ELLIOKitDumper _showService:parent:options:] in ELLIOKitDumper.o
导IOKit的时候编译会出这样错误,是为什么呢?有没有朋友遇到过?

你好,请问找到获取iOS9进程运行时间的方法了么?

哥们,这咋遍历出来呢?

IOKit建议动态解析符号。

获取出来的进程大概是这样子吧,怎么看这个进程呢?

1 个赞

您解决了么