No aggregate frame stats of the Native Activity sample - android

I run the Native Activity sample on MI Pad 4 Plus, with Android version 8.1.0. It's ok. Then, I run "adb shell dumpsys gfxinfo com.example.native_activity ". It shows a little bit of information, without aggregate frame stats nor HISTOGRAM. Attached please find the screenshot.
Is there any settings needed in the develop phase for this sample to get the gfxinfo?
Screenshot

Related

How to use Android dumpsys framestats

I want to measure the FPS of my Android Augmented Reality app. I am trying to follow the documentation for using dumpsys framestats.
This is my procedure:
connect device (Galaxy Tab S5e) via USB to computer (MacBook Pro)
Launch application
Open terminal and enter adb shell dumpsys gfxinfo <PACKAGE_NAME> framestats
I get results. The documentation says that I should get some CSV data (which I do). Here it is:
Flags,IntendedVsync,Vsync,OldestInputEvent,NewestInputEvent,HandleInputStart,AnimationStart,PerformTraversalsStart,DrawStart,SyncQueued,SyncStart,IssueDrawCommandsStart,SwapBuffers,FrameCompleted,DequeueBufferDuration,QueueBufferDuration,
1,270900288236110,270901404902732,9223372036854775807,0,270901406732543,270901407052751,270901407062751,270901480932022,270901488003689,270901488511137,270901489180876,270901502575459,270901504554157,1520000,1026000,
1,270901416955482,270901500288812,9223372036854775807,0,270901507061241,270901507131709,270901507732074,270901524054574,270901524125251,270901524430720,270901524804834,270901531068480,270901534144522,3249000,1831000,
Firstly, why is there only two rows, if:
"Each line of this output represents a frame produced by the app"
If I wait and then rerun the command, I again only get 2 rows. Sometimes the values have updated, but other times they have not...
The documentation says that I can calculate frame time with:
(FRAME_COMPLETED - INTENDED_VSYNC)
So, I thought I could run the ADB command after say, 1 minute, get out a load of frame times and then graph it, but if I only get out 2 frames at a time... and if rerunning the ADB command does not update the data... how can I measure Frametimes? What am I missing here?
I am writing my bachelor thesis and using this adb command to get framerate. In my experience, the framerate data is updated only when the screen is changed. For example, you have a long list. If you don't scroll it, you only see limited framerate data, but if you scroll it, there will be more framerate data (but the maximum number of frames is 122 )

Printing log-data with ADB/Unity and OculusGo/gearVR

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*

How to automate basic sanity on android?

My aim is to run an automated test to check the bare minimum on my android build once its loaded on the device
Boot to the Homescreen
Turn WIFI on/off
Turn BT on/off
Start Camera - take snapshot
Switch to Camcorder - take a short video
Run audio and video
Log to a file what passed and what failed.
I would like to do this entirely using adb.exe on windows host.
What I want to know is how do I test each of the above options from adb shell command line?
Thanks in advance!
Consider using Android Compatibility Test Suite (CTS).
For example, after you've downloaded the CTS test package, to test the Camera you could issue a command on the host that looks like the following:
./cts-tradefed run cts --class android.hardware.cts.CameraTest

How do I get Logcat for multiple devices running at the same time in Eclipse

I have two android devices connected to the same station. I would like to view the logcat for both while running them in debug mode in eclipse.
I have had SOME luck with the following steps:
Run the app on Device 1
Run the app on Device 2
Open a new window (window/new)
In the new window, open view logcat
About 40% of the time this results in in each eclipse window showing data from a different phone... but not always. It seems to be almost a luck-of-the-draw kind of thing. More often than not both windows show the same device. If I open device viewer and select a device in either window both change.
How can I do this all the time?
This is a very late reply but probably you didn't find a solution.
Solution:
Click Window ---> Show View ---> Other ---> Android ---> Devices.
Simply click on a device to switch to its logcat.
You can try to use adb in two different console windows to get the logcat for each one.
Example:
in console window 1: adb -s <device01_serial> logcat
in console window 2: adb -s <device02_serial> logcat
As takecare said.
This is how you can do it:
Find the device id's of Device 1 and Device 2. Do this by opening a shell prompt and typing the command
adb devices
You'll get a list of connected devices and their id's.
Run the command
adb -s [device_1_id] logcat
Where [device_1_id] is the device id of your Device 1 which you obtained in the first step.
Open another shell and do the same as in step 2, but for you Device 2.
I don't believe there's a good way to do this. You can approximate it though. One option is (as other answers have suggested) to use logcat from adb. This obviously isn't as pretty. Another is to run DDMS directly (instead of through Eclipse) for your second window. This gets you pretty close and gives you two logcat windows each with their own device selectors. The DDMS executable is found in the tools folder of your Android installation.
Here's the way I handle switching between device's logcat output using Juno M20120914-1800.
Unfortunately it is not automatic, but it is at least the most reliable way I've found yet, and once you get used to doing it, it's not that bad.
I click on the device icon in the toolbar.
I click on the device name.
Then I click on logcat again and it will show the device I selected.
It seems like this should be a feature, to be able to monitor more than one device/AVD at a time.

Take automated Screenshot of emulator

I want to take automated screenshots of a running emulator, e.g. every 10 seconds and then save them into a directory.
I found out that I can do screen capturing with DDMS, but only over the UI. Is there any console based scripting API?
If you want to do it on System side then take a look at Android-DDMLIB. And Droid#Screen Also look at this tutorial Android: How to take screenshots from command line.
Or if you want to do all this at android device side then you have to root permission and read the device framebuffer for it.

Categories

Resources