To help anyone who searches for this problem (which probably happens under Windows as well):
- Build and Run your app with both “Development Build” and “Autoconnect Profiler” enabled; I know, it’ll stop with the error, but the app should be installed on the device;
- When you see the error “Unable to forward traffic to device”, check the Editor Console to find the error; it also shows the complete command-line that Unity used when trying to connect. It looks like this:
/(some_path)/Sdk/platform-tools/adb -s "ce09160128d8321405" forward "tcp:34999" "localabstract:Unity-com.somename.someproject"
-
Copy the command you see exactly as shown (select it and CTRL+C), and then close Unity;
-
Open a terminal (on Ubuntu: CTRL+ALT+ T), and paste the same command there (on Ubuntu: CTRL+SHIFT+V). Press ENTER, of course; you should see no errors, which means that adb accepted the command now;
-
Open Unity again, and wait until it finishes loading;
-
Now manually run your app on the connected Android (do not disconnect the device from the USB cable, just run the app manually while still connected); you should see the Profiler running against your app – if not, then change the “Active Profiler” (a combobox located at the top of the Profiler window).
That is a bit annoying but you only need to do that once per session. After connected, you can rebuild as many times as you wish without having to repeat the process.
Good luck!