Month: May 2015

Handy adb commends for Android

list devices

1
adb devices

install & uninstall apk

1
2
adb install -r ~/Download/myapk.apk
adb uninstall com.ynjan.myapp

start an activity

1
2
adb shell am start com.ynjan.myapp/.MainActivity
adb shell am start com.ynjan.myapp/com.ynjan.myapp.MainActivity

list installed packages

1
adb shell pm list packages -f

reboot

1
adb reboot

enter devices’s shell

1
adb shell

make input in shell

1
2
3
4
5
6
7
usage: input ... 
   input text <string> [delay]
   input keyevent <key code number or name>
   input [touchscreen|touchpad] tap <x> <y>
   input [touchscreen|touchpad] swipe <x1> <y1> <x2> <y2>
   input trackball press
   input trackball roll <dx> <dy>

for example

1
2
3
4
#unlock screen
input keyevent 82
#device power on/off
input keyevent 26

android key codes

clear application data

1
adb shell pm clear com.ynjan.myapp

Logging

1
2
3
4
5
6
7
8
9
# log with tag
adb logcat -s TAG_NAME_1
# log with priority
adb logcat "*:PRIORITY"
adb logcat -s TAG_NAME:PRIORITY
# log with keyword (regex)
adb logcat | grep "SOME_KEYWORDS"
# clear log
adb logcat -c
Tags : , ,

[QA]How to set php upload_max_filesize in .htaccess?

php_value upload_max_filesize 10M

need enable AllowOverride in root

AllowOverride Options
Tags :