I have a problem while developing VR-Applications. I am creating a game, and the only way to test it is building and uploading it on the Oculus Go. I could live with that, right until now where I have a problem with the behaviour of the controller. I want to log some sensor data, but due to the fact that the app is builded and started on the device, Unity can of course not read any output from it.
My workaround is to display the log data in the VR, which is really annoying. I was thinking about something like running ADB on the computer while the app is running (Oculus Go has the same core as the GearVR does, Android based), but I couldn't manage that either, mainly because the code is written in C# in Unity and I don't know if its translated correctly to the Android Log Commands.
This can be used for debugging and seeing the output from Debug.log() from the oculus go:
adb logcat -s Unity ActivityManager PackageManager DEBUG *your log tag here*
Related
I am trying to debug a Wear OS complication provider, and I cannot find any instructions on how to do so.
I didn't write it, and I'm new to Android development - I'm trying to diagnose a bug in an Open Source project.
I have the phone and watch emulators working (both are Android 11, x86) and paired. The app deploys and runs on both. When I try to debug the Wear OS side, however, a vast majority of the breakpoints aren't being hit (and don't have the little checkbox in Android Studio).
The code for the actual app will debug fine - it hits breakpoints. But the code that provides data for the face and the complication provider won't attach - breakpoints are inactive.
I tried attaching to ALL the processes on the watch at once. I went through them one-by-one. Nothing - none of the processes seem to have the complication provider code in them - or if they do, the debugger can't find it.
I've been banging my head on this for a couple days. According to Google "complication provider" and "attach debugger" do not exist on the same page anywhere on the internet.
Is it simply not possible? It looks like faces can be debugged but it doesn't seem to be working either.
Thanks in advance!
Here is the use case -
I want to plug in an android phone to a Windows machine with Android Studio (Logcat running).
I then want to open an app on the phone, perform a bunch of actions, and then review the log to see if the app accessed location/personal data directory/contacts/etc.
Is there a way to do this without rooting the device?
Does Logcat have a record of such events, or perhaps a logging application I have missed in my searches?
I guess the heart of the question - how do you audit an app to make sure it isn't doing something it should not?
I'm currently developing a small android app which communicates with a FTDI chip over USB so I can't use logcat to get the logs live. Unfortunatly the Android device is a Galaxy Tab 2 with Android 4.1.2 which I'm not allowed to root. That means adb-wireless won't work too. And because it's just a small app setting up a bugtracker system like ACRA seems a bit oversized.
Is there another way to get the logs of my app?
Many thanks
I can't think of any "live" logcat output, but you can view your Logcat Output (which is Buffered) via adb logcat. Test the things in your app you want to do or to get the Error you try to solve, then connect the USB to a Computer running adb and dump the Log.
More information for the logcat Command can be found here
You can make a utility function that opens an HTTP connection and writes to a web server.
This adds a little overhead to your application, but works fine to get log info.
Easy to implement, no rooting required!
Or you could write a little service that runs a web server that responds to requests with a dump on logcat (or a tail or logcat or something).
It might even be possible to write a shell script that uses curl or wget to do this (that is send get requests to a webserver in order to pass logcat output), but you might need to install them, which in turn you might need root for, so... maybe this wouldn't meet your needs.
I guess it might even be possible to create a network share on your workstation, mount it on your android device and just redirect logcat output to a file on the share. But I didn't try it - let me know if you do!
You could use apps like Logcat or others alike, which will give you the same output as your IDE Logcat console.
You can turn on the logging, do your stuff in your app, and return to the logcat app to check out the log, mail it to yourself etc.
I did a little bit more research and it seems that there's no possibility to read the logs easily without having root rights. You're able to read the logcat output using bugtracking libraries like ACRA in your Android app, but it's a lot more effort to include them and analyze the logs.
I'm going to develop on my own (rooted) tablet with adb-wireless now.
when I run my Android application with an emulator, it works perfectly, and so it does on my phone, but on another phone, trying to run the app, I always get the "Unfortunately [...] has stopped" error. How can I find out the reason for this error (Using the emulator, I could look it up in LogCat, but not on a real phone)??
Thanks in advance!
On a real phone, you can use the tool aLogCat to view logs on the device itself. You can also connect it to your computer via USB and use the adb logcat tool, and the logs will be visible from the computer's shell window.
Adb logcat could also be used over a wireless network with a tool like WiFi ADB, should you prefer wireless methods.
Android Remote Stacktrace is a quite useful library/script that allows you to easily add a way for a phone to send its crash logs your way.
Simplest would in this case probably be to add it to a test version you put on the other phone. Since it's not being actively developed (afaik), you may not want to put it in a normal store release build.
I am a newbie to Android and the Eclipse development environment and would like some advice on best practices for debugging my apps when they throw a Force Close.
I have researched ADB, however, I can not get this to interact with my phone even though I have explicitly turned debug mode to true on my test handset.
Obviously Android comes with a LOG method which I have seen utilized in many example apps, can someone please explain how to review these logs quickly and how to setup logging appropriately to determine the cause of a Force Close (always occurs when I push the Home button).
Any advice on debugging effectively in Eclipse would be much appreciated!
Sincerely,
Ryan
To debug using your device, you will need to have debug mode turned on (which it sounds like you do), you will then need to have the phone plugged in with the USB connector. From here, you can tell Eclipse to run/debug.
Eclipse should ask which device to use (this is done because there should be multiple devices available for running/debugging since your device is plugged in). At this point, you can select your actual device from the list, and you should be up and running.
If you are using android.util.Log, then your logs will show up in LogCat. If you do not see LogCat by default in your Eclipse environment, you can add it by doing the following:
Go to Window -> Show View -> Other
Select Android -> LogCat
Cick OK.
When running/debugging your device, you should see your Log statments in LogCat.
As I have never been able to get Eclipse to refresh the LogCat when I'm debugging on device, I will add this :
You can also debug from command line like this :
"adb -d logcat"
However, as the windows command line is awfully basic, the line are cut in 2 most of the time.
And my asking about your OS does help because the procedure is not the same to set up device debugging if you are on windows or linux or mac.
For instance, in the case of windows, you need to install a driver (you can find all the doc here) before being able to debug on a device.