[Xperia SP Q&A, Help & Troubleshooting] mrjraider:
How to collect data​

In this thread you can read all about collecting data to help yourself and us users with fixing your issues or problems. In this thread I will explain a some things with screenshots. If you have questions do not hesitate to post or contact me!​

1: How to collect Wakelocks?​

What is a Wakelock?

- A wakelock is an application, service or process that prevents the phone from getting into deepsleep.

What is DeepSleep?

- DeepSleep is the name of the state from the CPU. In this state is the CPU almost off. The CPU is in a sort 'Stand-by" function where it keeps the needed functions working (like calls, sms, contact with your operator). In DeepSleep the battery usage is very low. When you turn your screen back on the CPU will start running normal again.

Where can I check my battery stats?

- See picture:

To collect the wakelock data you need an application that collect this. Here on XDA-Developers there is an application called Better Battery Stats it can be found here: Link. This application is free here on XDA and costs about €2 in the Google Playstore (which is more than fair since it is an amazing application).

There is another one which I use a lot: WakeLock Detector. This one can be found for free in the Google Play Store: Link

When you have installed a Wakelock Detector you need to use your phone as you normaly do. Do this for 24 hours to get as much data as possible. If you install BetterBatteryStats, root is needed for extra detailed information (see its thread). With the application WakeLock Detector you can see systemwakelocks aswell. However you need to enable this in settings see below:

After you use your phone for a while you will see a list like this:

(mine is very short because its connected to my pc)

If you see some "for your eyes" weird ones. Google them. Most of them can be found either here on XDA or on any other Android website ;)

An amazing thread about WakeLocks and How to prevent them: Link.

You can check a bit futher. For other wakelocks you can select between a few diffrent settings:

For system wakelocks you can see a bit more. Some wakelocks do have its own wakelocks. For example Google Service has more in it than you might thing. By clicking on the wakelock you can see exact what the cause of the wakelock is:

2: How to create a logcat​

A logcat is a logfile which tells us what the Android System is doing and where the things go wrong and what the cause may be. The logcat has some very nice information... if you know how to read them.

The only thing needed is ADB.

What is ADB?

- ADB stands for Android Debug Brigde. And is used for Debugging in Android. It is also needed to pull and push files and to fix things and even to help you deodex your ROM. It has some handy commands to remember..

Normaly ADB comes with the Android SDK kit which you can download here: Link.

Where can I find ADB Commands?

- See below:

-d - directs command to the only connected USB device
returns an error if more than one USB device is present.
-e - directs command to the only running emulator.
returns an error if more than one emulator is running.
-s <serial number> - directs command to the USB device or emulator with
the given serial number. Overrides ANDROID_SERIAL
envivornment variable.
-p <product name or path> - simple product name like 'sooner', or
a relative/absolute path to a product
out directory like 'out/target/product/sooner'.
If -p is not specified, the ANDROID_PRODUCT_OUT
environment variable is used, which must
be an absolute path.
devices - list all connected devices
connect <host>:<port> - connect to a device via TCP/IP
disconnect <host>:<port> - disconnect from a TCP/IP device

device commands:
adb push <local> <remote> - copy file/dir to device
adb pull <remote> <local> - copy file/dir from device
adb sync [ <directory> ] - copy host->device only if changed
(see 'adb help all')
adb shell - run remote shell interactively
adb shell <command> - run remote shell command
adb emu <command> - run emulator console command
adb logcat [ <filter-spec> ] - View device log
adb forward <local> <remote> - forward socket connections
forward specs are one of:
tcp:<port>
localabstract:<unix domain socket name>
localreserved:<unix domain socket name>
localfilesystem:<unix domain socket name>
dev:<character device name>
jdwp:<process pid> (remote only)
adb jdwp - list PIDs of processes hosting a JDWP transport
adb install [-l] [-r] <file> - push this package file to the device and install it
('-l' means forward-lock the app)
('-r' means reinstall the app, keeping its data)
adb uninstall [-k] <package> - remove this app package from the device
('-k' means keep the data and cache directories)
adb bugreport - return all information from the device
that should be included in a bug report.

adb help - show this help message
adb version - show version num

DATAOPTS:
(no option) - don't touch the data partition
-w - wipe the data partition
-d - flash the data partition

scripting:
adb wait-for-device - block until device is online
adb start-server - ensure that there is a server running
adb kill-server - kill the server if it is running
adb get-state - prints: offline | bootloader | device
adb get-serialno - prints: <serial-number>
adb status-window - continuously print device status for a specified device
adb remount - remounts the /system partition on the device read-write
adb reboot [bootloader|recovery] - reboots the device, optionally into the bootloader or recovery program
adb root - restarts the adbd daemon with root permissions
adb usb - restarts the adbd daemon listening on USB
adb tcpip <port> - restarts the adbd daemon listening on TCP on the specified port

networking:
adb ppp <tty> [parameters] - Run PPP over USB.
Note: you should not automatically start a PPP connection.
<tty> refers to the tty for PPP stream. Eg. dev:/dev/omap_csmi_tty1
[parameters] - Eg. defaultroute debug dump local notty usepeerdns

adb sync notes: adb sync [ <directory> ]
<localdir> can be interpreted in several ways:

- If <directory> is not specified, both /system and /data partitions will be updated.

- If it is "system" or "data", only the corresponding partition
is updated.

To use ADB on your device you need to enable "USB Debugging"

Here is how:

If you have that enabled you need to install ADB. Google it. There are a lot of guides you can follow so I am not gonna write it down here.

When you have enabled USB Debugging and ADB is installed you can go futher.

To create a logcat you need to check if your device has been found by the pc and ADB.

To do so open a commantprompt and enter the following command:

Adb Devices

This will pull a list like this:

When there is no device it will show this:

To create a logcat enter the following command

adb logcat

If you press enter this will happen:

This is impossible to collect and to read. So we need to sort this out.

Try to use this command to sort it out:

adb logcat -v long > name of problem.txt

This command makes every logline seperate so that you will get a clean file that is a bit easier to read.

The output file can be found in C:\[name of drive]\[user]

When you have your file you need to understand it. Every single line starts with a letter. This letter has a purpose:

V — Verbose (lowest priority)
D — Debug
I — Info (default priority)
W — Warning
E — Error
F — Fatal
S — Silent (highest priority, on which nothing is ever printed)

Most of us will give the entire log to the developers of an application or ROM. But with this you can try to solve problems on your own.

- Work in progress - ​