Wednesday, April 24, 2013

ADB, some useful lines of code (for end user)


ANDROID

Some useful lines of commands for any user wanting to know what's going on : 
Quelques commandes utiles pour toute personne voulant savoir ce qu'il se passe:



In terminal, just type the following lines, 
Dans le terminal, tapez simplement les lignes qui suivent
In ADB, add "adb" before the commands 
Dans ADB, ajoutez "adb" devant les commandes
If you want not to display the output in terminal, specify the path : 
Si vous ne voulez pas afficher les sorties dans le terminal, spécifiez le chemin :


command > /where_you_want_your_output_to_be_stored/name_you_want_for_the_log

to know how much swap there is (total and free are what you want to know)
pour connaitre la quantité de swap disponible : 
free

to know if KSM is really turned on : 
cat /sys/kernel/mm/ksm/run

to know what modules are running : 
lister les modules chargés :
lsmod


install an app from terminal : 
installer une application depuis le terminal :
pm install /sdcard/app1.apk
from adb : 
depuis ADB :
adb pm install /home/user/app1.apk

your kernel crashed?
votre kernel a rendu l'âme?
cat /proc/last_kmsg
ex : from adb, and stored in /home/user/last_kmsg1
adb cat /proc/last_kmsg > /home/user/last_kmsg1

an app crashed, you want to know why?
une application a cessé de fonctionner, et vous voulez savoir pourquoi?
logcat
ex : from adb and stored in /home/user/myfirstlogever
adb logcat > /home/user/myfirstlogever

don't have an USB cable ?or adb "other the air" : 
 connect to your home wifi network (both device and pc)
 in settings/dev options/ enable adb on TCP/IP
Code:
adb connect xxx.xxx.xxx.xxx:5555
 (the IP is the one displayed in the option you choose previously 
 and then, since it is connected, catch the log :
adb logcat > /home/user/myfirstlogever