sky201503 / android-apktool-1

Automatically exported from code.google.com/p/android-apktool
0 stars 0 forks source link

Cannot Attach Debugger to Application on Device #338

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
After following the steps at 
http://code.google.com/p/android-apktool/wiki/SmaliDebugging, one cannot attach 
the NetBeans debugger to the target process on the device. Related question: 
http://groups.google.com/group/apktool/browse_thread/thread/67db0bc642b86fcf.

In short, we have followed the steps outlined at 
http://code.google.com/p/android-apktool/wiki/ReportingIssues: rebuild apk 
without doing any changes to it ("apktool d" & "apktool b -d").

It appaers APKTOOLS does not create a well formed AndroidManifest.xml for 
debugging use. The application element *lacks* debuggable="true", so one cannot 
attach a debugger to the process running on a device.

This could also be expected behavior from APKTOOLS. If this is expected 
behavior, I would expect to see a Step 2a at 
http://code.google.com/p/android-apktool/wiki/SmaliDebugging: "Open 
AndroidManifest.xml and add android:debuggable="true" to the application 
element". For example:

  <application android:label="Cool App"
               android:icon="@drawable/app_icon"
               android:name=".CoolApplication"
               android:debuggable="true">

Since we are asking APKTOOLS for a debug build, I would expect 
debuggable="true" already in place.

Original issue reported on code.google.com by noloa...@gmail.com on 2 Aug 2012 at 10:41

GoogleCodeExporter commented 9 years ago
Yes, you're right, apktool doesn't add this parameter, so you have to add it by 
yourself. It should be added automatically xor I should update SmaliDebugging 
page.

Thanks for your suggestion.

Original comment by Brut.alll on 3 Aug 2012 at 6:03

GoogleCodeExporter commented 9 years ago
   --debug-mode
       inserts android:debuggable="true" in to the application node of the
       manifest, making the application debuggable even on production devices.

I used new aapt functionality to auto inject it using aapt on build.

Original comment by connor.tumbleson on 18 Nov 2012 at 5:42