On December 28, 2017, wechat released version 6.6.1 and launched a small program called “Tiaotiao” on the second floor of wechat homepage (drop-down), which instantly flooded wechat moments.
When everyone is busy with the game, someone invented a unique way based on Python + WebDriverAgent to achieve a PC remote control of the mobile phone “jump” small program to automatically jump, brush the score to the outrageous point, quietly occupy the first place in the circle of friends.
There have been several popular articles detailing how to do this, but more or less the description is not detailed enough, and the parameter Settings only work well on some models. This also caused me to tread a few holes in the implementation process following these tutorials. This article is based on the Macbook + iPhone 6s Plus to explain how to achieve the above process, and will also step on the pit record.
Environment to prepare
Install python3
Download and click Install. Download address: www.python.org/downloads/m… Run the following command in terminal to check whether PYTHon3 is installed successfully.
~ python3 -V
Python 3.6.4
Copy the code
Create the PYTHon3 virtual environment
Address: document docs.python.org/3/tutorial/… The method is as follows:
~ python3 -m venv tutorial-env
~ sourceTutorial - env/bin/activate ➜ ~ (tutorial - env)Copy the code
Install the PIP
Install the Python package management tool PIP. IO /en/latest/ I… The method is as follows:
(tutorial - env) ➜ ~ curl https://bootstrap.pypa.io/get-pip.py - o get - PIP. Py (tutorial - env) ➜ ~ python get - PIP. PyCopy the code
Install xcode
Install via appstore
Install WebDriverAgent
Xcode, as new as possible. Update Xcode to the latest version as much as possible and keep the iPhone version older than 9.3.
Download the code from Github
git clone https://github.com/facebook/WebDriverAgent
Copy the code
Installation of Carthage
brew install carthage
Copy the code
Run the initialization script
./Scripts/bootstrap.sh
Copy the code
The script downloads all dependencies using Carthage and packages the response JS files using NPM
After the execution is complete, double-click the webDriverAgent. xcodeProj file.
Set up the certificate
To set the certificate signature, check the personal account in the Team column.
Run and test
Select WebDriverAgentRunner in xcode-product-scheme.
Run xcode-product-test
Port forwarding
~ brew install libimobiledevice
~ iproxy 8100 8100
Copy the code
Use iProxy –help to find more specific usage. At this time by visiting http://localhost:8100/status to confirm whether WDA run successfully.
And inspector http://localhost:8100/inspector, inspector is used to check the UI layer, convenient to write the test script
Use Python to control the iPhone to automatically jump
Get the Python hop code
Warehouse address: github.com/korbinzhao/…
git clone [email protected]:korbinzhao/wechat_jump_game.git
Copy the code
Install the facebook – wda
(tutorial-env) ➜ ~ pip3 install --pre facebook-wda
Copy the code
Installation project dependencies
(tutorial-env) ➜ wechat_jump_game git:(master) qualify pip3 install-r requirements. TXTCopy the code
Copy the device configuration file in./config/iPhone, rename it, and replace it with./config.json
Open the mini program interface on the phone and run the Python script
(tutoral-env) ➜ wechat_jump_game git:(master) university python3 wechat_jump_auto_iOSCopy the code
The final result
The resources
- Use Python to play Wechat jump
- Wechat jump a jump MAC + iPhone graphic tutorials
- How to install WebDriverAgent on iOS