Issues Attempting to link debugger for Unity App

Hey,

I have an app made with Unity compiled with Gradle.
I am attempting to use the debugger, it launches the app but can’t connect the debugger.

I am using the SHIELD Tablet and it is not rooted.

Any suggestions would be appreciated.

Hi StevenBrooks,
We need more information here:

  • Your tablet android version
  • TGD version
  • Can your app run without launching through TGD?
  • Is your app debuggable?
  • Your detailed steps of reproducing this issue
  • What is the error output?
  • Your tablet android version?
    7.0

  • TGD version?
    Version 2.3.21089841

  • Can your app run without launching through TGD?
    Yes.

  • Is your app debuggable?
    Yes - I set the value manually in my manifest just in case.

  • Your detailed steps of reproducing this issue?

  1. Make Build, Generate APK, Install APK on SHIELD.
  2. Open Tegra Graphics Debugger.
  3. Install Debugger on SHIELD.
  4. Launch associated APK, choose CustomUnityPlayerActivity intent (app start).
  • What is the error output?
    Debugger Reads:
    -A bunch of lib operations-
    Launching /.CustomUnityPlayerActivity
    Could not locate process: - Trying Again
    Find target process. pid:4660 x ∞

Tablet Reads:
Waiting For Debugger
Application is waiting for debugger to attach.

  • Additional Information
    Checking the list of process names once my app is launched in “Attach” shows my app at PID 4660 grey’d out.

I have not added any .so’s to my app nor did I change my render from gles2 to the NVidea option (my project isn’t set up with a mk file) and my device is unrooted.

I find the documentation a little confusing because any topic I can find in this forum is normally pretty old and often has contradicting information. (You need to add libraries vs you don’t)

I actually did manage to connect the Debugger.
It seems to work randomly.

it will print a few "Find target process. pid:4660"s and then succeed the connect.

would there be something I could do that might make it more consistent?

My New Question: How come I don’t have the “Profiler” option which give a graphics shader breakdown in my View dropdown?

I am on a Mac.

[url]http://docs.nvidia.com/tegra-graphics-debugger/2.0/index.html#developertools/mobile/tegra_graphics_debugger/tgd_frame_profiler.htm%3FTocPath%3DTegra%2520Graphics%2520Debugger|Frame%2520Debugging|_____7[/url]

Hi StevenBrooks,

I have not added any .so’s to my app nor did I change my render from gles2 to the NVidea option
On the latest version of TGD, you don’t need to add .so to your app

would there be something I could do that might make it more consistent?

  • What is the version of Unity?
  • Can you share adb logcat and kernel log when it doesn’t work?

My New Question: How come I don’t have the “Profiler” option which give a graphics shader breakdown in my View dropdown?

Profiler is replaced with a more powerful Range Profiler in latest version. But I believe shader breakdown is removed.

Thanks.

What is the version of Unity?
I believe I was using unity 5.5.0p4 to make the build.

Can you share adb logcat and kernel log when it doesn’t work?
Next time it doesn’t connect I will post the logs here.

Thanks for the Information.

I’m a different person with the same problem.

Shield Tablet, not rooted, Android 7.0
TGD 2.3.21089841
Unity 5.3.6.p7

Build process:
New Unity Project
Set player settings: Bundle Identifier to anything
Enable Build Settings:Android Platform: Development Build, Script Debugging
Build and Run android platform

Launching the app from the debugger gets stuck repeating “Find target process. pid:22633”
“Attach” does not think the process is attachable.

logcat: http://pastebin.com/bCMNCdSn

ADB path is not in the user settings. Checking to see if ADB is in the PATH.
Found ADB executable at location: C:/NVPACK/android-sdk-windows/platform-tools/adb.exe
Starting adb server, please wait...
Scanning for devices...
Waiting for the device to become available
Device Product Model: SHIELD Tablet
Checking If adbd has root permission
Waiting for the device to become available.
Detected current device is running Android M
Setting SELinux policy to permissive.
setenforce: Couldn't set enforcing status to '0': Permission denied
Failed to change SELinux policy.
Failed to change SELinux policy.
ls: /vendor/lib64/egl/lib*.so: No such file or directory
ls: /system/lib64/egl/lib*.so: No such file or directory
Located 32-bit driver libraries in /vendor/lib
Host supports 32-bit graphics debugging
Graphics debugger version is correct.
Current device is not configurable.
Searching for packages installed on the current device.
Scanning for attachable processes on SHIELD Tablet - 0425114607299002b29f...
Scan for devices complete.
Process scan complete.
Unsetting property wrap.com.default.ProductName
Launching com.default.ProductName/com.unity3d.player.UnityPlayerActivity
Could not locate process: com.default.ProductName - Trying again.
Find target process. pid:22633
Successfully resumed
Find target process. pid:22633
Find target process. pid:22633
Find target process. pid:22633

Hey dude. Check your Android Manifest. Make sure there is a tag on your Application which says android:debuggable=“true”

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.default.ProductName" android:versionName="1.0" android:versionCode="1" android:installLocation="preferExternal">
  <supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true" />
  <application android:theme="@style/UnityThemeSelector" android:icon="@drawable/app_icon" android:label="@string/app_name" android:debuggable="true" android:isGame="true" android:banner="@drawable/app_banner">
    <activity android:name="com.unity3d.player.UnityPlayerActivity" android:label="@string/app_name" android:screenOrientation="fullSensor" android:launchMode="singleTask" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale">
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
        <category android:name="android.intent.category.LEANBACK_LAUNCHER" />
      </intent-filter>
      <meta-data android:name="unityplayer.UnityActivity" android:value="true" />
    </activity>
  </application>
  <uses-sdk android:minSdkVersion="9" android:targetSdkVersion="25" />
  <uses-feature android:glEsVersion="0x00020000" />
  <uses-permission android:name="android.permission.INTERNET" />
  <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="18" />
  <uses-feature android:name="android.hardware.touchscreen" android:required="false" />
  <uses-feature android:name="android.hardware.touchscreen.multitouch" android:required="false" />
  <uses-feature android:name="android.hardware.touchscreen.multitouch.distinct" android:required="false" />
</manifest>

Hi corysama,

I didn’t see TGD in your adb logcat. Did you launch your app through TGD?

The codeblock below the logcat pastebin link is the TGD log from lauching the app through TGD

Launching com.default.ProductName/com.unity3d.player.UnityPlayerActivity
Could not locate process: com.default.ProductName - Trying again.
Find target process. pid:22633
Successfully resumed
Find target process. pid:22633
Find target process. pid:22633
Find target process. pid:22633

After a long time, it reports “Could not locate process: com.default.ProductName - Trying again.” and repeats.

Hi corysama,

I meant the lines containing “TGD” in adb logcat, for example:

03-08 11:17:08.590 30750 30750 I TGD     : Find the api level: 24
...
03-08 11:17:11.858 30750 30819 I TGD     : Starting GTI initialization...
...
03-08 11:17:11.966 30750 30819 I TGD     : Graphics interception initialized

Also, please try with the newly released TGD v2.4

Thanks.

TGD v2.4 fixed my problem right up! Send my thanks to the team!

Hey so it seems that if I have Android Studios open before i launch the Tegra Debugger that it will not be able to find the process.

If I close Android studios and re-launch the app through the debugger it will end up working.

Is there a way to change what ports either service is working on? Could it be that they are trying to use the same port?

Hi StevenBrooks,

Are you using Android Monitor in Android Studio?