tasker支持的shell 命令大全

前端之家收集整理的这篇文章主要介绍了tasker支持的shell 命令大全前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
参考
http://www.notenoughtech.com/tasker/tasker-run-shell-commands/

罗列所有系统配置项
settings list system settings list global settings list secure

以下是双卡管理

settings put global mobile_data1=0/1
settings put global mobile_data2=0/1
settings put global user_preferred_data_sub=1/2
settings put global mobile_data 0/1
settings put global multi_sim_data_call 1/2

stop ril-daemon
start ril-daemon
stop ril-daemon1
start ril-daemon1
stop ril-daemon2
start ril-daemon2

settings put system switch_dual_card_slots 0/1

settings put global multi_sim_voice_call_slot
settings put global multi_sim_data_call_slot

settings put Global Config_current_primary_sub 0/1

am broadcast -a android.intent.action.SUB_DEFAULT_CHANGED
content://telephony/siminfo

以上内容更新2017年8月11日 (未整理)

1.获取触摸球状态

settings get system show_touches

显示触摸球(1显示,0关闭

settings put system show_touches 1

2.获取触摸点坐标

settings get system pointer_location

是否显示触摸点坐标(1显示,0隐藏)

settings put system pointer_location 1

3.京东金融签到页面

amstart-ncom.jd.jrapp/com.jd.jrapp.ver2.common.web.WebActivity-esWEBURL https://m.jr.jd.com/spe/shake/checkin/index.html

以上内容更新时间2017年8月10日

在塔斯克运行shell命令大全(需要root权限):

1.如果手机已经root,但是tasker检查不到root,请安装supersu,仅需安装不需要激活

2.停用开发者模式里面的“hw叠加层”,据说可以加快手机反应速度,注意重启后会自动关闭,所以建议建立开机任务

service call SurfaceFlinger 1008 i32 1

3.切换selinux,关闭selinux的话,很多破解软件就能安装了

setenforce 0   (关闭

setenforce 1  (开启)

4.修改设备id(一般用于刷机后,恢复之前的设备id,防止微信数据还原后,需要新手机登录验证)

settings put secure android_id 16e123123123123123123    (设置为16e123123123123123123)

settings get secure android_id            (获取设备id)

5.tasker获取网页xml时防止卡住其他任务,建议使用curl,(tasker自带HTTPget,httppost网络连接不成功时,会卡住整个tasker执行,curl不会)

curl www.baidu.com

输出存储到变量%ret,%ret即网页内容

如果要带cookies,加参数就行,举例

curl -b 哈哈哈我是cookies内容 www.baidu.com

6.微信中打开网页(可以用作公众号自动签到类)(关键字 tasker open url with wechat 微信 网页 url)

am start -n com.tencent.mm/com.tencent.mm.plugin.webview.ui.tools.WebViewUI-d http://www.baidu.com

7.手机qq中打开网页(可以用作公众号自动签到类)(关键字 tasker open url with qq 网页 url)

am start -n com.tencent.mobileqq/.activity.QQBrowserDelegationActivity --es urlhttp://www.baidu.com

以上内容更新时间2017年7月25日 12:48:39

启动程序

am start -n 包名/包名+类名(-n 类名,-a action,-d date,-m MIME-TYPE,-c category,-e 扩展数据,等)。

pm list packages 列出所有应用

飞行模式开/关
1
settings put global airplane_mode_on 1; am broadcast -a android.intent.action.AIRPLANE_MODE --ez state true
2
settings put global airplane_mode_on 0; am broadcast -a android.intent.action.AIRPLANE_MODE --ez state false

开/关移动数据
1
svc data enable
2
svc data disable

检查文件夹是否存在(1 =无0 = YES)
1
[ -d /sdcard/DCIM/Camera/ ] && echo 1 || echo 0
存储输出%变量

提取ZIP文件文件%)
1
unzip %file /sdcard/

移动文件,复制文件
1
mv /original/path /new/path
2
cp /original/path /new/path

删除文件删除文件
1
rm /path/to/file
2
rm -r /path/to/folder

文件,写变量(%VAR)到文件
1
cat /path/to/file
2
echo %var > /path/to/file
存储输出%变量

制造商/系统可重写,使系统只读
1
mount -o remount,rw /system
2
mount -o remount,ro /system

更改文件权限(/系统/ etc / hosts文件为例)文件权限类型(7 = RWX; 6 = RW; 4 = R)(CHMOD(根:组;用户))
1
chmod 644 /system/etc/hosts

检查文件的md5sum
1
md5sum /path/to/file

检查进程正在运行(返回过程或空)
1
pgrep -x com.package.name(修改为pgrep -f program_name 列出进程名为 program_name 的ID 2017年2月14日 15:36:56
存储输出%变量

停止当前下载
1
am force-stop com.android.providers.downloads
2
pm clear com.android.providers.downloads

杀死一个应用程序(例子:chrome浏览器)
1
am force-stop com.android.chrome

重新启动系统UI
1
pkill -l TERM -f com.android.systemUI

重启,重启恢复
1
svc power reboot
2
svc power reboot recovery

截图到SD卡
1
screencap -p /sdcard/screengrab.png

检查键盘输出(1 =无0 = YES)
1
cat /proc/$(pgrep com.touchtype.swiftkey)/oom_adj
存储输出%变量

IP检测(-c计数,-i间隔-s PACKETSIZE,-t TTL = XXX IP)
1
ping -c 3 xxx.xxx.xxx.xxx
存储输出%变量

储存最后输入坐标
1
getevent -lc 3 /dev/input/event1 | grep ABS_MT_POSITION_.
存储输出%变量

模拟用户的击键输入
1
input tap X Y

模拟用户长按输入(持续时间250)
1
input swipe X1 Y1 X1 Y1 250

模拟文本输入
1
input text sampletext

模拟用户划屏(Z =时长)
1
input swipe X1 Y1 X2 Y2 Z

模拟特定键(例子:返回)
1
input keyevent 4

KeyEvent名单:
0 --> "KEYCODE_UNKNOWN"
1 --> "KEYCODE_MENU"
2 --> "KEYCODE_SOFT_RIGHT"
3 --> "KEYCODE_HOME"
4 --> "KEYCODE_BACK"
5 --> "KEYCODE_CALL"
6 --> "KEYCODE_ENDCALL"
7 --> "KEYCODE_0"
8 --> "KEYCODE_1"
9 --> "KEYCODE_2"
10 --> "KEYCODE_3"
11 --> "KEYCODE_4"
12 --> "KEYCODE_5"
13 --> "KEYCODE_6"
14 --> "KEYCODE_7"
15 --> "KEYCODE_8"
16 --> "KEYCODE_9"
17 --> "KEYCODE_STAR"
18 --> "KEYCODE_POUND"
19 --> "KEYCODE_DPAD_UP"
20 --> "KEYCODE_DPAD_DOWN"
21 --> "KEYCODE_DPAD_LEFT"
22 --> "KEYCODE_DPAD_RIGHT"
23 --> "KEYCODE_DPAD_CENTER"
24 --> "KEYCODE_VOLUME_UP"
25 --> "KEYCODE_VOLUME_DOWN"
26 --> "KEYCODE_POWER"
27 --> "KEYCODE_CAMERA"
28 --> "KEYCODE_CLEAR"
29 --> "KEYCODE_A"
30 --> "KEYCODE_B"
31 --> "KEYCODE_C"
32 --> "KEYCODE_D"
33 --> "KEYCODE_E"
34 --> "KEYCODE_F"
35 --> "KEYCODE_G"
36 --> "KEYCODE_H"
37 --> "KEYCODE_I"
38 --> "KEYCODE_J"
39 --> "KEYCODE_K"
40 --> "KEYCODE_L"
41 --> "KEYCODE_M"
42 --> "KEYCODE_N"
43 --> "KEYCODE_O"
44 --> "KEYCODE_P"
45 --> "KEYCODE_Q"
46 --> "KEYCODE_R"
47 --> "KEYCODE_S"
48 --> "KEYCODE_T"
49 --> "KEYCODE_U"
50 --> "KEYCODE_V"
51 --> "KEYCODE_W"
52 --> "KEYCODE_X"
53 --> "KEYCODE_Y"
54 --> "KEYCODE_Z"
55 --> "KEYCODE_COMMA"
56 --> "KEYCODE_PERIOD"
57 --> "KEYCODE_ALT_LEFT"
58 --> "KEYCODE_ALT_RIGHT"
59 --> "KEYCODE_SHIFT_LEFT"
60 --> "KEYCODE_SHIFT_RIGHT"
61 --> "KEYCODE_TAB"
62 --> "KEYCODE_SPACE"
63 --> "KEYCODE_SYM"
64 --> "KEYCODE_EXPLORER"
65 --> "KEYCODE_ENVELOPE"
66 --> "KEYCODE_ENTER"
67 --> "KEYCODE_DEL"
68 --> "KEYCODE_GRAVE"
69 --> "KEYCODE_MINUS"
70 --> "KEYCODE_EQUALS"
71 --> "KEYCODE_LEFT_BRACKET"
72 --> "KEYCODE_RIGHT_BRACKET"
73 --> "KEYCODE_BACKSLASH"
74 --> "KEYCODE_SEMICOLON"
75 --> "KEYCODE_APOSTROPHE"
76 --> "KEYCODE_SLASH"
77 --> "KEYCODE_AT"
78 --> "KEYCODE_NUM"
79 --> "KEYCODE_HEADSETHOOK"
80 --> "KEYCODE_FOCUS"
81 --> "KEYCODE_PLUS"
82 --> "KEYCODE_MENU"
83 --> "KEYCODE_NOTIFICATION"
84 --> "KEYCODE_SEARCH"
85 --> "TAG_LAST_KEYCODE"

获取电池省电配置文件状态/启用/禁用
1
settings get global low_power
2
settings put global low_power 1
3
settings put global low_power 0

Greenify打盹启用/禁用
1
am stopservice com.oasisfeng.greenify/.DozeService
2
pm disable com.oasisfeng.greenify/.DozeService
3
/
4
pm enable com.oasisfeng.greenify/.DozeService
5
am startservice com.oasisfeng.greenify/.DozeService

显示您的电池电量,健康和温度(输出需求格式化)
1
dumpsys battery | grep health
2
dumpsys battery | grep temperature
存储输出%变量

Wi-Fi(扫描总是可用)ON / OFF
1
settings put global wifi_scan_always_enabled 1
2
settings put global wifi_scan_always_enabled 0

调整屏幕和复位
1
wm overscan 150,750,0
2
wm overscan reset

查询的Wi-Fi(扫描总是可用)状态
1
settings get global wifi_scan_always_enabled
存储输出%变量

查询当前已启用位置提供商
1
settings get secure location_providers_allowed
存储输出%变量

查询启用无障碍服务
1
settings get secure enabled_accessibility_services
存储输出%变量

查询启用通知监听器
1
settings get secure enabled_notification_listeners
存储输出%变量

启用一项辅助服务(例子:自动输入)
1
settings get secure enabled_accessibility_services
存储输出%变量:
settings put secure enabled_accessibility_services %Variable:com.joaomgcd.autoinput/com.joaomgcd.autoinput.service.ServiceAccessibility

启用通知监听器(AutoNotification例子)
1
settings get secure enabled_notification_listeners
存储输出%变量:
settings put secure enabled_notification_listeners %Variable:com.joaomgcd.autonotification/com.joaomgcd.autonotification.service.ServiceNotificationIntercept

切换3g4g

adb shell su -c 'am broadcast -a gravityBox.intent.action.CHANGE_NETWORK_TYPE --ez networkType 1'

Open tasker
Create a new task - misc - send intent

Paste the following into the action Box: "gravityBox.intent.action.CHANGE_NETWORK_TYPE"

Paste the following into the extra Box:
"networkType:2"

The above will switch to3g. Change the 2 as per below as required.

0 - 2G/3G auto (3Gpreferred)
1 - 2G
2 -3G
9 (or 10) - LTE

// NETWORK_MODE_* See ril.h RIL_REQUEST_SET_PREFERRED_NETWORK_TYPE  int NETWORK_MODE_WCDMA_PREF = 0; // GSM/WCDMA (WCDMA preferred)  int NETWORK_MODE_GSM_ONLY = 1; // GSM only  int NETWORK_MODE_WCDMA_ONLY = 2; // WCDMA only  int NETWORK_MODE_GSM_UMTS = 3; // GSM/WCDMA (auto mode,according to PRL)**  int NETWORK_MODE_CDMA = 4; // CDMA and EvDo (auto mode,according to PRL)** int NETWORK_MODE_CDMA_NO_EVDO = 5; // CDMA only  int NETWORK_MODE_EVDO_NO_CDMA = 6; // EvDo only  int NETWORK_MODE_GLOBAL = 7; // GSM/WCDMA,CDMA,and EvDo (auto mode,according to PRL)** int NETWORK_MODE_LTE_CDMA_EVDO = 8; // LTE,CDMA and EvDo  int NETWORK_MODE_LTE_GSM_WCDMA = 9; // LTE,GSM/WCDMA  int NETWORK_MODE_LTE_CDMA_EVDO_GSM_WCDMA = 10; // LTE,EvDo,GSM/WCDMA  int NETWORK_MODE_LTE_ONLY = 11; // LTE Only mode.  int NETWORK_MODE_LTE_WCDMA = 12; // LTE/WCDMA  int NETWORK_MODE_TDSCDMA_ONLY = 13; // TD-SCDMA only  int NETWORK_MODE_TDSCDMA_WCDMA = 14; // TD-SCDMA and WCDMA  int NETWORK_MODE_LTE_TDSCDMA = 15; // TD-SCDMA and LTE  int NETWORK_MODE_TDSCDMA_GSM = 16; // TD-SCDMA and GSM  int NETWORK_MODE_LTE_TDSCDMA_GSM = 17; // TD-SCDMA,GSM and LTE  int NETWORK_MODE_TDSCDMA_GSM_WCDMA = 18; // TD-SCDMA,GSM/WCDMA  int NETWORK_MODE_LTE_TDSCDMA_WCDMA = 19; // TD-SCDMA,WCDMA and LTE  int NETWORK_MODE_LTE_TDSCDMA_GSM_WCDMA = 20; // TD-SCDMA,GSM/WCDMA and LTE  int NETWORK_MODE_TDSCDMA_CDMA_EVDO_GSM_WCDMA = 21; // TD-SCDMA,GSM/WCDMA int NETWORK_MODE_LTE_TDSCDMA_CDMA_EVDO_GSM_WCDMA = 22; // TD-SCDMA/LTE/GSM/WCDMA,and EvDo


@H_403_838@Send Intent [ Action: gravityBox.intent.action.CHANGE_NETWORK_TYPE Cat: None Mime Type: Data: Extra: networkType:1 Extra: Package: Class: Target: Broadcast Receiver] networkType enum values are: 0: WCDMA Preferred 1: GSM only <-- This would be "2G" on GSM networks 2: WCDMA only <--WCDMA is "3G" on GSM networks. You may know it as HSPA 3: GSM auto (PRL) 4: CDMA auto (PRL) 5: CDMA only <-- This would be "2G" on CDMA networks 6: EvDo only <-- EvDo is "3G" on CDMA networks 7: GSM/CDMA auto (PRL) 8: LTE/CDMA auto (PRL) 9: LTE/GSM auto (PRL) 10: LTE/GSM/CDMA auto (PRL) 11: LTE only 12: "unknown"
 
@H_403_838@settings put global preferred_network_mode 1

settings put global preferred_network_mode 9
settings put global preferred_network_mode1 9
settings put global preferred_network_mode2 9

setenforce permissive;
svc data disable;
setenforce enforcing
原文链接:https://www.f2er.com/bash/391253.html

猜你在找的Bash相关文章