Thursday, November 28, 2013

Android command line tips

Allow Unknown Sources (w/ non root user)
settings put global install_non_market_apps 1
or
settings put secure install_non_market_apps 1

Change screen resolution:
#am display-size 800x480

Connect WiFi network
#wpa_cli
> scan
> scan_results
> list_networks
> add_network
0
> set_network 0 ssid "MY_SSID"
> set_network 0 psk "MY_PSK"
> enable_network 0
> save_config
> ^D

Button press from command line!
POWER
# input keyevent 26
BACK
# input keyevent 4
VOL +
# input keyevent 24
VOL -
# input keyevent 25
MENU
# input keyevent 82
SEARCH
# input keyevent 84

Remount /system rw
# mount -o remount,rw -t ext4 /system 

get Android version via adb (https://stackoverflow.com/a/29968138)

adb shell getprop ro.build.version.release 


to get API level:
adb shell getprop ro.build.version.sdk 
You can see all available properties with this command:
adb shell getprop

No comments:

Post a Comment