shell脚本自动打卡打开微信

com.isoftstone.client.ipsa

com.isoftstone.client.ipsa

am start -n com.isoftstone.client.ipsa/com.isoftstone.ipsa.app.activity.SplashActivity

使屏幕点亮

input keyevent 224

滑动屏幕开锁 swipe <x1> <y1> <x2> <y2> [duration(ms)] (Default: touchscreen)  

input swipe 300 1800 300 800

打开软件

am start -n com.isoftstone.client.ipsa/com.isoftstone.ipsa.app.activity.SplashActivity

延时几秒


点击某一位置

input tap 240 1500

等待几秒

input tap 900 1470

点击打卡

应该一直循环判断时间

打卡

写入apk在某个范围是打卡或者开启应用闹铃提醒打卡

input keyevent 224
input swipe 300 1800 300 800
am start -n com.isoftstone.client.ipsa/com.isoftstone.ipsa.app.activity.SplashActivity
sleep 10
input tap 240 1500
sleep 11
input tap 900 1470

打开微信

//1、回到主界面
input keyevent 3
//2、打开微信
am start -n com.tencent.mm/com.tencent.mm.ui.LauncherUI
//3、延时反应一会
sleep 3
//4、点击进入联系人
input tap 500 450 
//5、进入输入菜单
input tap 1000  1850
//6、点视频聊天框
input tap 750 1350
//7、点击语音或视频聊天等待对方回复
input tap 600 1700 

手机内执行脚本不能分隔开?

#!/system/bin/sh
result=`sleep 3`
result=`input keyevent 3`
result=`am start -n com.tencent.mm/com.tencent.mm.ui.LauncherUI`
result=`sleep 5`
result=`input tap 500 450 `
result=`input tap 1000  1850`
result=`input tap 750 1350`
result=`input tap 600 1700`


>adb root
adbd cannot run as root in production builds
exit的话,先是退回到$,之后才是退出shell。
执行

$adb shell

#su

获取文件系统的读写权限,只需要执行shell脚本中一句 mount -o rw,remount /

调起 Activity

命令格式:

adb shell am start [options] <INTENT>

例如:

adb shell am start -n com.tencent.mm/.ui.LauncherUI

表示调起微信主界面。

adb shell am start -n org.mazhuang.boottimemeasure/.MainActivity --es "toast" "hello, world"

表示调起 org.mazhuang.boottimemeasure/.MainActivity 并传给它 string 数据键值对 toast - hello, world



点亮屏幕:

adb shell input keyevent 224

熄灭屏幕:

adb shell input keyevent 223

滑动解锁

如果锁屏没有密码,是通过滑动手势解锁,那么可以通过 input swipe 来解锁。

命令(参数以机型 Nexus 5,向上滑动手势解锁举例):

adb shell input swipe 300 1000 300 500

参数 300 1000 300 500 分别表示起始点x坐标 起始点y坐标 结束点x坐标 结束点y坐标

输入文本

在焦点处于某文本框时,可以通过 input 命令来输入文本。

命令:

adb shell input text hello

现在 hello 出现在文本框了。


2.模拟物理按键操作: input keyevent 3 

3.模拟点击操作:input tap 500 500

4.模拟滑动操作:input swipe 200 500  400 500


查看Android应用包名、Activity的几个方法


adb shell pm list packages

 如果想知道应用对应的apk文件在手机上的安装位置则可以在上面的命令后加-f参数


adb shell pm list packages -f

二、只有Apk的情况


(1)aapt


使用命令行aapt dump xmltree ColaBox.apk AndroidManifest.xml


(2)使用apktool

使用反编译工具apktool,反编译后打开AndroidManifest.xml文件,查找方式同“有源码情况”

(3)aapt

感谢“天地会珠海分舵”地址:http://blog.csdn.net/zhubaitian/article/details/38926679










三、没有apk,应用已经安装到手机或虚拟机中

1.logcat

.清除logcat内容,使用命令adb logcat -c

.启动logcat,使用命令adb logcat ActivityManager:I *:s

.启动要查看的程序,

2.dumpsys

(1)启动要查看的程序;

(2)命令行输入:adb shell dumpsys window w |findstr \/ |findstr name=





  • 1
    点赞
  • 19
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
以下是一个用 Shell 脚本自动打卡微信千峰小程序上的示例: ```shell #!/bin/bash # 请在下面填入你的登录凭据和打卡信息 USERNAME="your_username" PASSWORD="your_password" LOCATION="your_location" # 登录微信 /Applications/WeChat.app/Contents/MacOS/WeChat -login -u $USERNAME -p $PASSWORD # 等待微信启动并扫码登录 sleep 10 # 启动微信小程序 # 请根据你的实际情况修改下面的命令,确保微信小程序在 Dock 中的位置 open -a WeChat && sleep 5 && osascript -e 'tell application "System Events" to tell process "WeChat" to click menu item "千峰小程序" of menu "Window" of menu bar 1' # 等待小程序启动 sleep 10 # 定位到打卡页面 osascript -e 'tell application "System Events" to tell process "WeChat" to tell window 1 to tell web area 1 to set value of text field 1 to "'$LOCATION'"' # 点击打卡按钮 osascript -e 'tell application "System Events" to tell process "WeChat" to tell window 1 to tell web area 1 to click button 1' # 等待打卡完成 sleep 5 # 关闭微信 osascript -e 'tell application "System Events" to tell process "WeChat" to click menu item "退出登录" of menu 1 of menu bar item "WeChat" of menu bar 1' # 退出脚本 exit 0 ``` 请注意,这个脚本是基于 macOS 系统的,使用了微信客户端,因此你需要将微信客户端的路径 `/Applications/WeChat.app/Contents/MacOS/WeChat` 修改为你的实际路径。另外,根据你的实际情况,可能需要对脚本进行一些调整。 请确保你已经安装了 WeChat 命令行工具,并且你已经登录了微信账号。运行脚本后,它将自动打开微信、进入千峰小程序、填写定位信息并点击打卡按钮,最后退出微信

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值