Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to prepare the APP crawler development environment

2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

Today I will show you how to prepare the APP crawler development environment. The content of the article is good. Now I would like to share it with you. Friends who feel in need can understand it. I hope it will be helpful to you. Let's read it along with the editor's ideas.

In the development of APP crawler, we usually use the mobile phone to connect to the PC agent for packet capture analysis, so when we grab the package in this way, we need to do the corresponding operation on the mobile phone, but it is impossible for us to grab the package manually all the time, so we need to use adb as a way of Android development commands. But now many mobile phone access control is relatively strict, directly connecting to the real machine, there are many operations are not supported, so it is necessary to use the simulator. Fortunately, there are many kinds of Android simulators, so let's introduce the simple construction and basic use of the APP crawler development environment.

Install the simulator

There are many kinds of Android simulators, Night God Simulator, Tencent Mobile Game Assistant, mumu Simulator are all commonly used simulators, of which Night God Simulator is better, but it does not support Mac system, mumu Simulator is developed by NetEase, supports Windows and Mac platforms, and updates frequently, so I use mumu Simulator, official documents and forums are also relatively rich. After installation, you can directly open it and use it. If you encounter problems, you can check it in the official FAQs.

Mac install adb

After installing the simulator, we will install adb. We will first install brew cask on Mac.

Install brew

Please read this article. Is the official installation of HomeBrew too slow and failed?

Install adb

Brew cask install android-platform-tools

After installing adb, open the console and type adb version

Then you can test with the real machine, open the "developer options" of the phone, enable "USB debugging" mode, and enter adb devices in the console.

This means that our adb has been installed, and here is the simulator that connects us.

Connect the simulator

Turn on "USB Debug Mode" in the simulator, then close adb server in the console, and then restart it.

Adb kill-server

Adb server

Check the connected device again at this time.

438ec4b1 is the real machine and emulator-5554 is the simulator. To connect the machine, use the following command

Adb-s 438ec4b1 shell

Connect the real machine to the simulator

You will find the difference in the red box. There is a $symbol in front of the ls connected to the real machine, and a # symbol in front of the ls connected to the simulator. The # symbol means that you have root permission, and the non-# symbol means that you do not have root permission. I have tried several real machines, all of which do not have root permission, which may require us to root them before we can use them normally. So that's why we have to use the simulator.

Since we do not debug on the real machine, we disconnect the connection, leaving only one connecting device in the simulator. In this case, our adb command can also be brief, such as using adb to connect to the device, which used to be adb-s xxx shell, and now you can write adb shell directly, as do other adb commands.

Install package capture software

The commonly used package grabbing software Fiddler, Charles and mitmproxy,Fiddler on the computer side belong to the Windows system, and have powerful functions. Charles is a cross-platform software, but its function is not as good as that of Fiddler. Using Charles,mitmproxy in Mac and Linux is also a cross-platform packet grabbing tool. Although it also has a visual interface, it is not friendly enough and the cost is relatively high, so we often use mitmproxy with Python to achieve crawling. Mitmproxy needs to write a special post, so I won't go into details here.

Install APP automatic operation software

Appium

Install Android Studio

Android Studio Chinese community download tool, open after installation will report an error, never mind

Open SDK Manager and install the corresponding SDK version

Set environment variabl

Add the following at the end of the vim ~ / .bash_profile file. If not, create a new one.

Export ANDROID_HOME=/Users/xxxx/Library/Android/sdk

Export PATH=$ {PATH}: ${ANDROID_HOME} / tools

Export PATH=$ {PATH}: ${ANDROID_HOME} / platform-tools

Export PATH=$ {PATH}: ${ANDROID_HOME} / build-tools/29.0.2

The ANDROID_HOME path is the SDK download path in the figure above.

PS: the build-tools/xx.xx.xx in the above environment variables needs to see the specific situation in the build-tools directory. We mainly need to use the aapt tool, so fill in the directory where aapt is located.

After configuration, execute the source ~ / .bash_profile command, reload the environment variables, and then type aapt-v to see if the command is running properly

3. Install JDK

Download JDK 8 from the official website, which requires a registered account, which is more troublesome. You can find the download on the third-party website. I downloaded it in a Baidu Cloud sharing link, but now I forget the address. I'm sorry.

Install the Python operation library

Pip install Appium-Python-Client

And then it can be used normally.

Airtest

Airtest is an automated testing tool developed by NetEase. Although it is not as professional as appium, it is easy to install and use. You can download it directly on the official website, and the documentation is relatively complete. The most important thing is that after installation, all test environments are OK. Then install pip install poco and you can use it. Most importantly, if you want to use and write scripts on other machines, you only need to install pip install poco, and you don't need to install Airtest tools.

These are all the contents of how to prepare the APP crawler development environment. For more information about how to prepare the APP crawler development environment, you can search the previous articles or browse the following articles to learn! I believe the editor will add more knowledge to you. I hope you can support it!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report