I'm working on a React-Native app, I am testing it on a physical android device, the MOTO Z2 Play. I would run an emulator, except I have an AMD processor on my rig and can't run those emulators, unfortunately.
So I'm trying to enable remote debugging on this device while developing, so I can see console.log() statements that I put in the code. The problem is that when I the debugger opens the browser and I go to the console to view the logs I see the following errors:
What do these errors mean, and how can I get the console to show logs? Or is there another way I can view logs without having to enable remote debugger? Thanks!
Related
I am trying to debug my flutter application on a Pixel 3 connected via USB. I've used a nexus already so i'm just trying a newer Google phone. I have the developer mode on and my surface pro recognizes it but VSCode says no device. Ive gotten this to work with older android phones so i'm not sure what else needs to be set up for it to work.
I've run flutter doctor and it says No devices available.
I have the developer mode on and my surface pro recognizes it but VSCode says no device.
If you are connecting a new device, it is possible that adb is not authorized on device.
It is possible that you dismissed/missed the dialog for USB debugging authorization where it shows RSA Key.
Go to the Developer options on the phone and click "Revoke USB debugging authorization", then connect your phone again and the dialog should appear:
I think the problem is flutter plugin could not detect android sdk
try and run this command :
flutter config --android-sdk [android-sdk-path]
My Pixel 3A has a USB "C" connector type. After I had removed and reinserted the cable about 100 times with no joy, I flipped the connector over, and magically the "RSA key" dialog appeared.
I may just have a wonky cable...
So I am writing an application for Android, then I tried to run in Debug mode by connecting my phone (Android 8.0) via usb, the application launches fine on the device and works fine, but in "Application Output" tab there is no log messages. When I run the application on my desktop (Ubuntu 18.04), the log messages are there. Then I tried to run the app on Release on my phone and more frustratingly the log messages are still not there and my app is behaving strangely, that is it fails to make network requests (not all of them but only a few) and it doesn't load data from the internet (everything works well in debug mode).
Here is my "Kits" configuration:
Retrying with latest Android 9.0 Pie update on LG G6, the problem is no longer present and adb logcat works as expected.
First of all, I'm positive that I've followed all steps in the Attaching MonoDevelop Debugger To An Android Device guide correctly (most importantly: having "Development Build" and "Script Debugging" enabled in the Build Settings).
When building & running a Unity Android app, however, my device (Samsung Galaxy S5, Android 6.0.1) just doesn't show up as a possible debug target in neither MonoDevelop, nor Visual Studio. For instance in Visual Studio, after clicking on Debug -> Attach Unity Debugger, in the "Select Unity Instance" window that opens I only see the Unity3d editor (Machine: local machine, Type: Editor). Debugging a Unity project that is run in the Unity Editor works fine, only debugging a project run on the physical android device doesn't work. It's the same for MonoDevelop.
I see the device as connected and online when doing
adb devices
I can also call adb shell commands (such as ls) on that device via command line. When I open Android Studio, I also see the device as a target for Logcat and even the just mentioned Unity Android app as a debuggable process (and when selecting it, all the correct logs that are expected from the running app).
I think it's safe to rule out a fault on the debugger side, because I tried
two different developer machines (both Windows 10 with current updates and without firewalls),
two different networks (home & university)
MonoDevelop, Visual Studio Community 2015, Visual Studio Professional 2017 RC (with respective Tools for Unity),
re-installing Unity3d,
different Unity3d projects (standard example project as well as own minimal example consisting of just a Text and a Button),
manually adding android:debuggable="true" to the project's AndroidManifest and
in Visual Studio manually connecting the debugger to the device via deviceip:5555 (in the "Select Unity Instance" Window -> Input IP).
On the device, I tried to
turning the phone off and on again,
turn USB debugging off & on,
selecting the Unity App as the "debug app" (in Developer options) and enabling/disabling "Wait for debugger" (also Developer options),
connecting the device via USB cable or via adb connect deviceip:5555 and
rooting the phone.
I don't know what else to try. I'm pretty sure it's something on the device. It has worked before, however I don't know what changed since then. Any tips are appreciated.
EDIT
Ok so I got some progress. When I examined the logcat output from the app, I found lines such as
Waiting for connection from host on [192.168.2.110:55416]...
(.2.110 being the IP of the device)
So I manually entered that IP & Port in Visual Studio in "Select Unity Instance" Window -> Input IP and right after that, the logcat read
PlayerConnection accepted from [192.168.2.115] handle:0x1c
(.2.115 being my developer machine)
So the connection is there. Visual Studio just doesn't "recognize" (?) it and doesn't switch to debugging mode so it can stop at breakpoints. Does anyone have an idea how I can force it to do so?
Well, not really an answer but I've found a way to debug it after all. Amidst all the logcat output, I've also found that line:
Using monoOptions --debugger-agent=transport=dt_socket,embedding=1,defer=y,address=0.0.0.0:56785
Taking that port (and the actual device IP) and entering it in Visual Studio in the "Select Unity Instance" Window -> Input IP, the debugger finally connected.
The problem is, that port gets changed every time the app is run so in order to debug it, I'll always have to look it up. Also (that may be a different issue altogether), the output of Debug.Log or Console.WriteLine isn't caught by the debugger. The only way to read the log for now is in AndroidStudio.
So yeah, the question still stands, how come the device doesn't show up as AndroidPlayer in the Select Unity Instance Window in Visual Studio (or according place in MonoDevelop)?
It does show up if your Android device is connected to wifi. When the app starts playing, you can see it in the "Select Unity Instance" box and then you can select it.
I am trying to run "unity remote 4" test project (http://u3d.as/content/unity-technologies/unity-remote-4/7PZ) on Unity Free for Mac.
I have "Unity Remote 4" installed on Samsung galaxy.
I have android SDK installed, adb devices command returns 0019e6197e378e device.
I have turned on all necessary developer options on the phone.
When I press Play in Unity, it says accepted incoming socket.
But nothing shows up on app but the welcome screen asking me to press Play in Unity.
Here are the steps you might be missing
Go to Edit Menu:- Project Setting:- Editor.
Under Unity Remote: Device choose "Any Android Device".
Connect your android device through usb cable.
Run unity Remote on your android device.
Now press play button in unity.
It will launch your game in android device.
Make sure no android emulator (bluestack, genimotion etc) is running in background. Sometimes priority of emulator gets higher than device and operations like "Build & run" or debugging etc starts producing their outputs on emulator rather than device :)
I'm new to android development, but I've been following the Google's tutorials on building an application. Unfortunately, I get stuck on "Running on a Real Device" because whenever I click Run as; Android Application nothing happens on my phone.
Any suggestions would be greatly appreciated.
Also:
My phone's a Motorola Razr M, running 4.1.2
USB debugging is enabled, unknown sources enabled.
Latest USB drivers are installed
My eclipse is part of the ADT bundle from Google.
Couple of things to try here (assuming your project has no errors):
Click on the arrow on the run button and then specifically select your project to run.
Check if you are able to run your project in an emulator also -- see screenshot below.
Below is how you check if your phone is recognized by Eclipse - if it is ... you will most definitely see a lot of output in LogCat. if your phone is successfully connected, you will see lots of messages scrolling in the logCat.