Skip to content

!!! Note: This is just a supplementary for Poco framework and AirtestIDE Editor. For complete information please check Poco Project Document.

6.1 Quick Start for Poco

Poco is an automation framework based on UI widget search. Different from Airtest which is based on image recognition, Pco can use method like poco("OK").click() to acquire and operate node. image

Supported Platforms

In most platforms, you need to first connect Poco-SDK before using Poco. Only in a few platforms (like native Android APP) can use Poco directly, these platforms include:

Platforms Airtest Poco
Cocos2dx-js, Cocos2dx-lua Access Document
Unity3D Access Document
Native Android APP Use directly
iOS Help Documents
Egret Access Document
Other engines Self access
WeChat Applet&webview The reference documents may become invalid with WeChat updates
Windows, MacOS Coming soon
Netease Help Documents

We are adding more platform to our list! If you need us to provide support for a specific platform you can tell us your need in Poco-github or contact us directly.

Beginner's guide use case

Be sure to check out Poco project document - Beginner's guide use case to learn the basics of widget selection and operation.

Getting started

If you want to experience the convenience of developing Poco script on ordinary Python using a local Python environment? Check out Quick Start for Poco. Import Poco into .py files to use its functions so that the script can be developed in any text editors and regular Python editors. At the same time you can use lightweight viewer like PocoHierarchyViewer to get widget attribute. But we have an easier way to acquire Poco widget and write script in AirtestIDE. Just follow the steps here:

  • Refer to the platform list above, and access Poco-SDK for your game or APP
  • When switching Poco APP type, a prompt will appear in the script editor to inform you to insert Poco initialization code. Click Yes will add the code of corresponding type at the beginning of the script.
  • Start Poco scripting Steps:

image

Poco window in AirtestIDE

There are a lot of functions in AirtestIDE to enable convenient Poco script writing. For example, click the Record button on poco window, and the system will generate the corresponding Poco statement according to your operation: image But these auto-generated statements usually don't work very well. Normally, we need to write more complicated staements and more accurate UI widget selection statements. In AirtestIDE, we can use pause to freeze the current UI element tree structure to check the widgets more carefully. Double click the nodes on the UI element tree to insert Poco statements automatically. You can adjust them to further enhance the readability and success rate of our script: image For detailed tutorial, please check out: Script Recording - 3.3 Poco Auxiliary Functions.

Try DEMO

Since the steps to access SDK is quite complicated, we provided some Demos for different platforms. You can try them out and familiarize yourself with Poco. For more info, check out Poco Examples and Tutorials.

More problems

Why can't I see the UI tree after selecting Poco mode.

Here you can see the list of platform we currently support. For now only native Android App can be used directly without access to SDK. Other engine requires access to SDK to get UI structure info (you can't see the UI tree of the game without access to SDK). Make sure you read the Access Document carefully, get access to SDK before using.

Why can't I see the UI tree using a native APP or having had access to SDK?

When initializing Poco, related apk will be installed into the phone, please make sure you have enable the permissions. Some models requires you to enable options like "Enable installiong through ADB". There are phones that require extra settings. For example, set Yosemite as the default input method. For these examples, please check out: Problems with Devices of Some Manufacturers.

The UI tree was not properly refreshed after a period of time

Try changing the drop-down menu of the Poco mode option to Stop and reselect the mode you need. E.g. Android, IDE will reestablish Poco communication connection with the phone. Sometimes the phone may automatically close the background pocoservice process due to insufficient memory, causing disconnection. In this case, it is recommended to try another phone with better configuration.

Others

Visit our Github page AirtestProject to see our open source Poco, Poco-SDK, and optional PocoUnit projects. If you have more questions, please contact us to help us improve the project better.