I’m testing an Android application. I used APKTOOL to decompile/recompile (with debug symbols). I performed a debug code sign, and then installed the APK. The program appears to run fine.
According to APKTOOL, I should be able to attach to the running process in NetBeans. But I’m only getting choices to attach to processes on localhost. DDMS is not showing a process tree and associated debug sockets as depicted in Figure 1 of Using DDMS. This is expected for all applications since I’m running a release kernel, but unexpected for the target process. I used DDMS to locate the PID on the device, but NetBeans claims “Not a valid PID” when I try to attach via PID. I also have the NBAndroid plugin installed.
How does one use NetBeans to attach to a process running on a device?
Jeff
OK, found the issue. Even though I was asking APKTOOL for debugging information (ie,
apktool -d ...), the tool did not generate a well formed AndroidManifest.xml (or fix-up the existing manifest). The manifest lackedandroid:debuggable="yes"in theapplicationelement. Or the APKTOOL documentation omitted the step…“Cannot Attach Debugger to Application on Device,” http://code.google.com/p/android-apktool/issues/detail?id=338.
There’s also another problem lurking here: NetBeans 7.2 cannot consume the Smali files (even though previous version of NetBeans could). So there is no live analysis because the debugger cannot set breakpoints. See NetBeans/Smali Debugging is Broken (SmaliDebugging Page) and No MIME type for *.smali.