Profiling a game on android - Unity - android

I'm trying to profile a game on real android device.
After I build and run it (with dev build, auto connect profiler and script debugging enabled) and setting android player instead of Editor in profiler/console options I can see that profiler window is working perfectly, but my console is not showing logs. (It did once (3 logs) but I cannot make it show logs again.)
Any suggestions of how I can make unity console show mobile logs?

You can create new text document using notepad and insert the following text below and save it as .bat file:
Your Drive:
cd location of the android sdk
adb logcat -s Unity ActivityManager PackageManager dalvikvm DEBUG
so for example in my case it's:
D:
cd AndroidSDK\sdk\platform-tools
adb logcat -s Unity ActivityManager PackageManager dalvikvm DEBUG
from here you can see all the debug logs that comes from Unity

Related

Difference between flutter logs command and IDE debug window

When you have a Flutter project open in Android Studio or VSCode, and you run it (either on a real device or emulator), you have a debug window available where you can see your print messages.
Does the "flutter logs" command show the exact same thing as this?
If not, what accounts for the difference?
The "flutter logs" command is used to display log output in the terminal, while the IDE debug window is used to display log output in the integrated development environment (IDE) such as Android Studio or Visual Studio Code. The "flutter logs" command is useful for viewing log output when running the app from the command line, while the IDE debug window is useful for viewing log output when running the app from within the IDE. Both of these tools display the same log output, but in different locations.

How to view Android app output through USB/ADB

New to ADB and Android, so excuse my likely butchering of the terminology..
Google has an app available through their GitHub page (gps-measurement-tools) that allows you to view NMEA output in a terminal window, if you launch the app through Android Studio.
My question is now, how can I do this via the CMD and ADB, i.e. without relying on launching the app through the Android Studio? I know how to launch the app, but I don't see any output in the terminal window.
Many thanks
The output you see in Android Studio is just logcat. To reproduce without the Studio - start the app and then run logcat in the same adb shell session or adb logcat in a new window.
To see just NMEA events use the filter:
adb logcat GnssLoggerNmea:D
You have to launch the application from Android Studio but on your Android Device using ADB.
Install ADB driver for your device on your laptop/pc.
Now enable Debugging mode in your Android Device.(For this you
have to enable developer mode on your android device).
Connect android device with your laptop/pc and select usb
debugging mode on android device.
Now launch application from Android studio.

How to run an app when it does not show under Apps?

I used ant to build my Eclipse project from the command line in a debug configuration. (Eclipse Luna and Android NDK-R10d is broken, so I can't use Eclipse any longer. Confer, Eclipse/ADT plugin cannot locate symbols for r10d NDK).
I then performed an install using adb:
<Project Directory>$ adb install bin/AndroidPrng-debug.apk
When I rummage for the program on the device in Apps, the program is not offered. When I attempt to search for it by name on the device (AndroidPrng and com.example.prng), I'm provided with useless web search results. When I go to Settings → Apps, the app is shown under the Downloaded tab (it shows the name as com.example.prng). It has the familiar Force Stop and Uninstall.
I have DDMS running and waiting to capture LogCat output from the program. But even though the app is on the device, I cannot figure out how to run it.
How do I run and debug the app when it does not show up under Apps?
Assuming that your app do have an Activity from where you can navigate into other parts of your app.
Try using below command:
$ adb shell am start -n com.example.yourpackagename/.YourMainActivity
or $ adb shell am start -n com.package.yourpackagename/com.example.yourpackagename.YourMainActivity
This am start command, is a command-line interface to the ActivityManager.

How to debug signed Android app from Eclipse?

Android 2.2.
I need to debug my signed APK on my Nexus S. How can this be done using Eclipse?
I start the app on my phone and then...?
Set the debuggable=true in the manifest, export, install and sign the the app. Connect the device via USB, enable USB debugging. Then open the DDMS perspective, select the device and attach to your app's process (you will see the package name listed). If you have a rooted device, you can connect to any process if adb is running as root.
When device connect to your eclipse running mechine , set debuggable=true in manifest file and enable debug mode in android phone it can view current running log using logcat, otherwise
You can debug your running application using adb tools from the command line
adb logcat - View device log
will display the current logcat (debug messages)
adb logcat [ <filter-spec> ]
using you can filter only your given debug messages
for configure debug tool view
http://developer.android.com/guide/developing/tools/adb.html
In Android Studio stable, you have to add the following 2 lines to application in the AndroidManifest file:
android:debuggable="true"
tools:ignore="HardcodedDebugMode"
The first one will enable debugging of signed APK, and the second one will prevent compile-time error.
After this, you can attach to the process via "Attach debugger to Android process" button.
You have two ways ..
You can use Log.v or log.d or Log.i (Logging) in your code and get all those logs in logcat view in eclipse while your application runs on your device.
You can run (while debugging , pressing that insect icon on eclipse ) the application from eclipse on device, By putting breakpoints in your code you can debug your application.

Android Debugging with Logcat and Emulator. Is it possible?

This is pretty simple: I'm using NetBeans on Linux with Android emulator 1.6. I have Logcat on my android phone, but the process of getting the messages to somewhere readable isn't smooth at all.
Can someone tell me how to get Logcat running on the emulator? Is there anything I can do to see debug messages other then having to copy the apk to my phone and testing it?
Thanks in advance!
You have a few options for viewing the debug log output, assuming you have the SDK installed and your command path set up correctly:
Type adb logcat. The log output from the connected device or running emulator will appear. I usually prefer adb logcat -v time to see the time stamps.
Type ddms. This launches the stand-alone version of DDMS. It has a logcat display at the bottom.
Install the ADT extension for Eclipse, and open the logcat view. (Since you're using NetBeans I assume this isn't what you want to do, but I'm mentioning it for completeness.)
In all cases, the interaction is the same whether you're using a physical device or software emulator, because the ADB daemon conceals the details. Whatever you're doing for the device is also expected to work for the emulator.
If you have a device and emulator connected simultaneously, you can use adb -e logcat for the emulator and adb -d logcat for the device. From stand-alone DDMS or Eclipse, just pick the device or emulator from the pop-up menu.
If you have setup nbandroid you can find the adb logcat viewer in netbeans under:
Window -> Output -> ADB Log
--edit
Just followed up on the post above and started using C:\Program Files (x86)\Android\android-sdk-windows\tools\ddms which is alot better then the one in netbeans.
The SDK comes with a handy tool called ddms it should be in the tools folder of the SDK.
At the moment an Emulator is running, or a mobile phone is connected to your machine it should show up in ddms and you can see all the log output in ddms.

Categories

Resources