Hi!
I’ve been using TGD with debuggable apps for a while, but I also want to profile non-debuggable builds. As I’ve searched this forum, it turned out that TGD checks for the “rooted” device by checking “adb root, adb shell id” so I have spent quite some time on making it work (and it finally does).
However, TGD still can’t launch the process as it fails at start (apps just crash)
Starting ADB server, please wait...
Scanning for devices...
Device Product Model: SHIELD Tablet
Detected current device is running Android N
Located 32-bit driver libraries in /vendor/lib/egl/
Waiting for the device to become available
Checking If adbd has root permission
Waiting for the device to become available.
Rooted device
Setting SELinux policy to permissive.
SELinux policy successfully changed to permissive.
Querying instrumentation property.
Checking debugger status...
Host supports 32-bit graphics debugging
Graphics debugger is enabled.
Scan for devices complete.
ABI: armeabi-v7a
Unsetting property wrap.com.myAwesomeAppBundleIdHere
Launching com.myAwesomeAppBundleIdHere/LaunchActivity
Scanning process...
Injecting debugger...
Debugger injection failed
Can't find process
As you can see, it sees the device as rooted, tries to launch some app, but it crashes instantly and TGD can’t find the process anymore (I have replaced bundle id and activity name)
Oooh I see now.
Yes, it’s rooted and I have spent quite some time to root it and to also appear as rooted to TGD (with that adb root thingy)
I have misunderstood your previous answer:
I thought that it meant that in order to profile a non-debuggable app the device must be rooted.
codym_nv can you please specify why would we possibly need to root our Shield Tablets for?
Hi,
It’s mainly for permission reason.
On a non-root device, we cannot debug a non-debuggable apk, because android system security doesn’t allow it. To debug an app, we will launch it with -D argument, but on non-debuggable apk and on non-rooted device, it’s not allowed by the system.
I confirm that the device is rooted and I can launch any APK with -D argument via ADB, and apps launch saying that they are waiting for the debugger.
If I do the same thing via TGD, it launches with the same message, but instantly crashes (most likely due to some internal debugging stuff) so TGD says that it can’t find the process anymore (because it has just crashed)
If I launch it with -D manually and then go to the “Attach” menu of TGD, it says that it can’t find any suitable process to attach to.
So the setup is:
Rooted device
TGD sees it as rooted
I can launch any app with -D argument (it launches and waits for the debugger)
When I “Launch” my target app via TGD, it launches with -D but instantly crashes
Here are some adb log messages right after crash:
WindowManager: Failed looking up window
WindowManager: java.lang.IllegalArgumentException: Requested window android.view.ViewRootImpl$W@dc9cda9 does not exist
WindowManager: at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:9165)
WindowManager: at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:9156)
WindowManager: at com.android.server.wm.WindowManagerService.removeWindow(WindowManagerService.java:2315)
WindowManager: at com.android.server.wm.Session.remove(Session.java:203)
WindowManager: at android.view.ViewRootImpl.dispatchDetachedFromWindow(ViewRootImpl.java:3442)
WindowManager: at android.view.ViewRootImpl.doDie(ViewRootImpl.java:6072)
WindowManager: at android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:3781)
WindowManager: at android.os.Handler.dispatchMessage(Handler.java:102)
WindowManager: at android.os.Looper.loop(Looper.java:154)
WindowManager: at android.os.HandlerThread.run(HandlerThread.java:61)
WindowManager: at com.android.server.ServiceThread.run(ServiceThread.java:46)