微信跳一跳这个小游戏最近很火,元旦的时候就发现了有人用python写的脚本可以刷跳一跳的分数,教程地址https://github.com/wangshub/wechat_jump_game。
但不是足够详细,下面我就用傻瓜式的方式来一个图文说明:
一 、安装WDA https://testerhome.com/topics/7220
1.1 github上下载代码 git clone https://github.com/facebook/WebDriverAgent
![](https://img.haomeiwen.com/i2397458/924321a8e9ddf9a7.png)
默认下载路径为根路径
![](https://img.haomeiwen.com/i2397458/598e106f4e6c73b0.png)
1.2 安装 carthage http://blog.csdn.net/Mazy_ma/article/details/70185547
如果没安装Homebrew,需要先安装Homebrew。(因为我已经安装过了,博客里面写的也很清楚就不多演示,到博客中的第二部就可以了,如果carthage version 有值说明安装成功了)
![](https://img.haomeiwen.com/i2397458/1aa56e51d4b5dcdc.png)
1.3 运行初始化脚本
![](https://img.haomeiwen.com/i2397458/e50ee50ce9d46277.png)
1.4 安装 WDA
运行代码,如果做过iOS开发的,相对来说很简单。要注意的是这里运行的test环境,快捷键command + u
控制台会打印一个IP地址,这时通过访问http://localhost:8100/status确认WDA是否运行成功。
![](https://img.haomeiwen.com/i2397458/bd26ee759fca965c.png)
1.5 如果http://localhost:8100/status没反应,需要安装端口转发工具 。
命令为 brew install libimobiledevice
这里我已经安装过了
![](https://img.haomeiwen.com/i2397458/8a615e6b99cc0c54.png)
1.6需要安装端口转发之后,转发端口。 iproxy 8100 8100
![](https://img.haomeiwen.com/i2397458/fd209245485da42a.png)
端口转发之后,就可以看到http://localhost:8100/status的json数据
![](https://img.haomeiwen.com/i2397458/bf813503a5ff52cc.png)
二、去github下载脚本 https://github.com/wangshub/wechat_jump_game
2.1 为了方便,直接下载到直面的一个skip文件夹下面。
通过cd命令,进入skip文件夹中。cd /Users/zhangshimin/Desktop/skip
下载wechat_jump_game脚本文件夹 git clone https://github.com/wangshub/wechat_jump_game.git
![](https://img.haomeiwen.com/i2397458/12eafe46c2c6824c.png)
2.2 安装Python3 https://www.python.org/downloads/release/python-364/
![](https://img.haomeiwen.com/i2397458/5e843d2f6cb13b40.png)
2.3 执行命令 pip3 install --pre facebook-wda
![](https://img.haomeiwen.com/i2397458/4214f07830089b31.png)
2.4 执行命令 pip3 install -r requirements.txt
![](https://img.haomeiwen.com/i2397458/f4fe16be53675a7c.png)
2.4 拷贝 ./config/iPhone 目录下对应的设备配置文件,重命名并替换到 ./config.json
![](https://img.haomeiwen.com/i2397458/7cbf9d277b7c4f1d.png)
![](https://img.haomeiwen.com/i2397458/72bdb1405908bbd0.png)
2.5 执行脚本文件 python3 wechat_jump_auto_iOS.py
因为不能上传视频,就放一张图片吧
好了,打开微信,跳一跳开始游戏就可以自动刷分了。(ps:开始我只是好奇,前天就弄了一个上午,发现还有很多人不会,就写了一篇文章。我只是起一个整理的作用,所有技术点和我没半毛钱关系。)
网友评论
请问这个怎么解决
recv failed: Resource temporarily unavailable
recv failed: Operation not permitted
模拟器也可以读取ip
size: 1242, 2208
scan_start_y: 250
1515730358 0 0 0 0
只出现了这个 啥也没有
运行代码,如果做过iOS开发的,相对来说很简单。要注意的是这里运行的test环境,快捷键command + u
控制台会打印一个IP地址,这时通过访问http://localhost:8100/status确认WDA是否运行成功。
请问这步具体怎么做啊?运行什么代码?
run_ctos_loop: fd = 12
run_stoc_loop: fd = 12
recv failed: Resource temporarily unavailable
recv failed: Resource temporarily unavailable
recv failed: Operation not permitted
recv failed: Resource temporarily unavailable
recv failed: Operation not permitted
recv failed: Resource temporarily unavailable
recv failed: Operation not permitted
recv failed: Resource temporarily unavailable
recv failed: Operation not permitted 遇到过不,前面步奏都成功的
这是为啥啊
然后发现 'RoutingHTTPServer/RoutingConnection.h' file not found
怎么解决
run_stoc_loop: fd = 4
recv failed: Resource temporarily unavailable
accepted connection, fd = 4
Number of available devices == 1
Requesting connecion to device handle == 43 (serial: 953ec3ebe6b47eed62c10415ee71fedd85227fb0), port 8100
waiting for connection
run_ctos_loop: fd = 4
run_stoc_loop: fd = 4
recv failed: Resource temporarily unavailable
accepted connection, fd = 4
waiting for connection
Number of available devices == 1
Requesting connecion to device handle == 43 (serial: 953ec3ebe6b47eed62c10415ee71fedd85227fb0), port 8100
run_ctos_loop: fd = 4
run_stoc_loop: fd = 4
recv failed: Resource temporarily unavailable
请问这个有遇到没?
A shell task (/usr/bin/xcrun xcodebuild -workspace /Users/zhoulihe/WebDriverAgent/Carthage/Checkouts/Alamofire/Alamofire.xcworkspace CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES -list) failed with exit code 72:
xcrun: error: unable to find utility "xcodebuild", not a developer tool or in PATH
请问这个要怎么解决 呜呜呜不是很懂
运行的时候报这个错,建立不了新连接
新建一个窗口,进到跳一跳目录,python3 文件名.py
这个错误怎么解决。。
,咋解决
accepted connection, fd = 4
waiting for connection
Number of available devices == 1
Requesting connecion to device handle == 2 , port 8100
Error connecting to device!
accepted connection, fd = 4
waiting for connection
Number of available devices == 1
Requesting connecion to device handle == 2 , port 8100
Error connecting to device!”这是什么情况?
我6S选的6的那个config.jason
Could not find a version that satisfies the requirement opencv-python==3.4.0.12 (from -r requirements.txt (line 6)) (from versions: 3.1.0.4, 3.1.0.5, 3.2.0.6, 3.2.0.7, 3.2.0.8, 3.3.0.9, 3.3.0.10)
No matching distribution found for opencv-python==3.4.0.12 (from -r requirements.txt (line 6))
size: 750, 1334
scan_start_y: 200
1515157443 0 0 0 0
然后打开游戏跳一跳 没有反应
您知道这是什么原因吗?
testTableViewCells encountered an error (Test operation was canceled. If you believe this error represents a bug, please attach the log file at /var/folders/0w/fllx6mnj7q361gl8v8bg83k00000gn/T/com.apple.dt.XCTest/IDETestRunSession-8DEC3ACA-B317-4F99-AC1B-EF8E1AB7987C/IntegrationTests_1-6E7AF9BE-1D30-41CE-9290-983D26B7498F/Session-IntegrationTests_1-2018-01-04_163403-2UZy7c.log)
Traceback (most recent call last):
File "wechat_jump_auto_iOS.py", line 7, in <module>
from PIL import Image, ImageDraw
ModuleNotFoundError: No module named 'PIL'
请问这是什么问题呢??
不行的话你把DNS改成 8.8.8.8 试试
pip3 install -r requirements.txt
这2个命令成功了吗
wda.WDAError: WDAError(status=13, value=To screenshot a frame, it must have non-0 area.为什么我刷新也获取不到Screen的图片呢