-
Notifications
You must be signed in to change notification settings - Fork 1.1k
How to debug an Xposed module? #138
Comments
Sorry, but I don't have any idea what you're talking about. Is this related to Xposed at all? |
Sorry, the question I asked may be too low. nstantRun: Exception while patching foo.bar |
Disable InstantRun please. |
@aviraxp thant you Still can not debug |
Is there a better development skills I now practice very troublesome, constantly restart each time I modify the code I need to restart the phone to take effect |
@qssq Are you trying to debug your Xposed module? I think it's somehow possible, but hard to achieve. Also, you indeed need to restart your device after making changes to your module, that cannot be changed. |
@rovo89 |
No, it's very hard to debug an Xposed module. I don't think I've ever done this myself before. |
I think I've found a solution. It's simple and effective: install [MM-O] Xdebuggable from the Xposed Installer. Enable it, reboot the phone, and after that you can select the app you hooked in the developer settings. After that start the hooked app, go to Android Studio on PC and click Attach debugger. It's the 2nd from the right: Now a new window will open. Here check "Show all processes" and select the hooked app. If you're done you can place a breakpoint in an XC_MethodHook (or Replacement or what you want) and when the breakpoint is reached, the app will stop executing and you will see the Variables section in the Debug menu filled like when you debug your own app:
I still didn't found out how could you stop at a breakpoint which is directly inside handleLoadPackage or in the main method of the other interfaces (so outside any XC classes), I think you need to attach the debugger to the system server but I have no idea how to do that because you can't find the android process in the list.. @rovo89 Could you put it in the wiki? I think it's useful to know, as you can see in the screenshot yesterday i tried to do the logging of everything but because of nulls it needs to be ugly or error prone, and also hard to modify, and also it's a lot of time to write the logging and a pain to read the detailed logs even if i try to format them with tabs EDIT: since i failed to install Xdebuggable (package installer said it cant be installed), i used the Advanced Logging module. It's in the repo, but this version is not working, the framework will log it's HackService class can't be found. You can do what i did: clone this project and build the module yourself. If you can't because you don't have disk space (NDK is big) or PC, tell me you need the apk and i will upload it here. |
First you need to be able to debug an android app using these three steps
After that ,you can add break point to you XposedModule method, and then trigger method within the target app, and start debugging note:
|
Does not support debugging or I operate a little problem? Deubg run found those breakpoints have become invalid icon, I tried to uninstall also try to restart the system is still unable to break
问 是不支持调试还是我操作有点问题? deubg运行 发现那些断点都变成无效的图标了 ,我尝试卸载也尝试重启 系统依然无法断点
The text was updated successfully, but these errors were encountered: