Wednesday, August 17, 2011

adbでタッチイベントを発生させる



http://stackoverflow.com/questions/4386449/send-touch-event-from-adb-to-a-device

To send touch event you need to do:

1 Set coordinates:

adb shell sendevent /dev/input/event2 3 0 x
adb shell sendevent /dev/input/event2 3 1 y
2 Send touch event (must have 0 0 0 pair):

adb shell sendevent /dev/input/event2 1 330 1
adb shell sendevent /dev/input/event2 0 0 0
3 Send release finger event (must have 0 0 0 pair):

adb shell sendevent /dev/input/event2 1 330 0
adb shell sendevent /dev/input/event2 0 0 0
Please note:

1 You can record events:

adb shell getevent
2 if you use getevent all event values are in hex.

Best regards, Yahor





Tuesday, August 16, 2011

Androidでロックパターンを忘れてしまった場合の解除方法

> adb -d shell
# sqlite3 data/data/com.android.providers.settings/databases/settings.db
sqlite> update system set value=0 where name='lock_pattern_autolock';
sqlite> .exit
# exit
> adb reboot

Sunday, August 14, 2011

am broadcast -a android.intent.action.BOOT_COMPLETED

起動時のアプリをつくる場合は
am broadcast -a android.intent.action.BOOT_COMPLETED
を投げる

Android コマンドラインでスクリーンショット

adb pull /dev/graphics/fb0 fb0
ffmpeg -vframes 1 -vcodec rawvideo -f rawvideo -pix_fmt rgb32 -s 480x800 -i fb0 -f image2 -vcodec png image.png

Ubuntuでスクリーンショット

gnome-panel-screenshot
でスクリーンショットを撮ることが出来る

vi ~/.bashrc
に
alias screenshot="gnome-panel-screenshot"
としておくと少しだけ幸せになれる


less /etc/fstab で起動時にドライブを自動マウントさせる

less /etc/fstab
で起動時にドライブを自動マウントさせる

UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx /mounteddata ext3 defaults 0 0
のようにHDDのUUIDを指定する

sudo blkid
で予めHDDUUIDを調べておくこと

grubの起動待ち時間等

sudo vi /etc/default/grub
GRUB_DEFAULT
GRUB_TIMEOUT
の値を変更すると起動時にデフォルトで選択されるOSとか
GRUBのタイムアウトする時間を変更可能

sudo update-grub2
で設定を反映