It takes about 6 minutes to read the text.


My friends often ask me in background messages that I spend a lot of time on wechat every day, and usually many repetitive operations need to be done by myself. While the efficiency is low, I am also half dead tired, asking me whether I can make it automatic.


The answer is yes, any human operation can be automated, automation can do anything.


Today, we will talk about several implementation schemes of wechat automation.


1.
wxpy



Based on ItChat, WXpy uses the communication protocol of wechat on the Web, and can realize wechat message management, friend management and some data statistics functions.


However, due to wechat’s restrictions on the web version of wechat, many newly registered wechat signals can not land on the web version of wechat; Therefore, if you want to use WXpy to do some automation, you need to use some old micro signals.



In addition, the specific operation must be limited frequency, or frequent operation may lead to operation failure, serious may face being banned.




2,
Airtest/Appium



The use of automation framework, including: Airtest, Appium, can be very good to avoid the restrictions of the official interface, completely simulate human operation.


It is only necessary to encapsulate commonly used wechat operations into different TestCases and combine Jenkins for timing scheduling.


It should be noted that since Airtest is not stable for iOS terminal, Appium is recommended for automatic operation of wechat on iOS terminal.


There are drawbacks to using an automation framework, such as the need for devices to be connected to a PC at all times or to be on the same LAN as the PC.


3,
UIAutomator2.0



Uiautomation 2.0 is an automated testing framework for Android.


You need to write an APP using AS, and then write some test scripts for specific functions.


In order to complete the automation of wechat, it is necessary to ensure that the mobile phone is after Root. In addition, after writing the test script, APK needs to be signed and packaged. For details, please refer to an article written before.


While the wool | revelation idle fish, a mobile phone, anytime and anywhere while wool


Of course, some commonly used wechat operation functions can use the Xposed framework, install some plug-ins to complete.




4,
Accessibility services



Compared with the above three solutions, barrier-free services can exist in the system as one service, and do not depend on PC and Root. Therefore, barrier-free services are the most recommended solution.


We can write specific business logic for each operation page, and then jump to the page regularly in wechat App, that is, we can complete most of the daily operations.


To ensure that services can always run in the background, you need to manually turn on the application startup switch for devices with advanced versions.



Recommended reading



Automation | article about Python automation scripts into APK




This black technology, not code can also play automation, efficient fishing




Python also gives you a clean, portable hard drive