This article is from the official account of the project: “AirtestProject” Copyright notice: It is allowed to be reproduced, but the original link must be retained. Do not use it for commercial or illegal purposes

1. Introduction

Students often raise some connection problems and version support problems when conducting automatic tests on iOS real machines. Here we sorted out some common iOS questions to answer, hoping to bring you some troubleshooting ideas.

2. Version support description

To automate tests on iOS devices, we need to start a WebDriverAgent service on the iOS real phone, either ios-tAgent of Airtest or WebDriverAgent of Appium.

Ios-tagent is supported as follows:

iOS-Tagent The minimum support The highest support
iOS 9.3 13.5
Xcode version 9.9 12.1

Especially for earlier versions of iOS, we recommend using Airtest’s ios-TAgent.

If you need to test higher versions of iOS, we recommend you to use WebDriverAgent of Appium, which is much more compatible with higher versions of iOS. (But iOS can be slow to respond)

3. Answer frequently asked questions

1) AirtestIDE whether it supports M1

Support; So far we have not found any problem with the AirtestIDE on M1. If there is any problem, you can tell us the specific situation through the express bill of lading channel:

Quick page of b/l: airtest.netease.com/issue_creat…

2) Can you conduct an automated test of iOS by leaving the AirtestIDE

You can test iOS automatically by leaving the AirtestIDE. Students can run iOS automation scripts using the command line or other editors such as PyCharm.

When you leave the AirtestIDE to conduct an automated test of iOS, you need to add your own commands/scripts to connect to iOS:

# command line connection iOS devices airtest run the test. The air - device iOS: / / / http://127.0.0.1:8100 # script connects the iOS Auto_setup (__file__, devices = [" iOS: / / http://127.0.0.1:8100 / "]) connect_device (" iOS: / / http://127.0.0.1:8100 / ") Init_device (platform = "IOS", uuid = "http://127.0.0.1:8100")Copy the code
3) iOS Poco initialization issues

The iOS Poco initialization must be placed after the iOS device connection script. Otherwise, the following message is displayed when the script is run:

"Please call connect_device to connect an ios device first"Copy the code

For the correct script order, see the following example:

# -*- encoding=utf8 -*- __author__ = "AirtestProject" from airtest.core.api import * from airtest.report.report import Simple_report, LogToHtml auto_setup (__file__, devices = [" iOS: / / http://127.0.0.1:8100 / "]) sleep (2.0) from poco. Drivers. The iOS import iosPoco poco = iosPoco()Copy the code
4) Whether iOS can be tested automatically without Mac

You can; After successfully deploying ios-TAgent or WebDriverAgent on iOS devices, we can use the open source tool TiDevice to test iOS devices without Mac.

For a tutorial on how to use TiDevice to connect to iOS devices, please refer to our previous post: iOS Automation without Mac, TiDevice tool will teach you how to make it easy! .

5) Unknown Command is displayed in inspector after port mapping

The inspector command is no longer supported on older versions of iOS, so students may encounter the following situations:

  • Visit http://127.0.0.1:8100/status show success
  • Visit http://127.0.0.1:8100/inspector shows unknown command

Don’t need to panic, at this time will be subject to the status of the situation, http://127.0.0.1:8100/status can access successfully and can see some json format of mobile phone information, it indicates that the start-up success; We can go to the IDE to connect to our iOS devices.

6) Check status successfully, but click CONNECT in IDE

There are also many students who successfully check status, but there is no response when they click connect to connect to iOS device in IDE. At this time, we can check the following problems:

  • Check whether the entered iOS string is correct
  • Whether the appropriate version is usedWebDriverAgent(Used in earlier versionsiOS-tagentAdvanced versions use AppiumWebDriverAgent, please refer to above for details)

If you are sure of the above, you can also close the IDE and open the AirtestIDE command line to see a log terminal. Click connect to view the detailed error message in the log terminal.

# on the Mac command line to start the AirtestIDE $CD/Applications/AirtestIDE app/Contents/MacOS $. / AirtestIDECopy the code

Further troubleshoot the problem according to the detailed error information.

7) Other common problems

We’ve compiled some other iOS faQs for our project:

  • The Xcode version is inconsistent with the iOS version
  • Frequently asked questions about developer certificates
  • Xcode failed to create provisioning profile
  • Problems with the first installation of trusted devices
  • The number of personal free certificate endorsement devices exceeds the upper limit
  • Failed to load package
  • Did not agree to the Apple agreement
  • Mac network fluctuation or instability
  • .

Students can check it out here: github.com/AirtestProj… .

8) Attached: iOS deployment tutorial
  • iOS-tagentDeployment Tutorial:Airtest.doc.io.netease.com/IDEdocs/dev…
  • iOS-tagentDeployment video tutorial:www.bilibili.com/video/BV1qf…
  • The AppiumWebDriverAgentInstallation tutorial:testerhome.com/topics/7220
  • The AppiumWebDriverAgentTroubleshooting:Github.com/appium/WebD…

4. Summary

Common problems about the iOS test automation, today will be to sort out here, if there are other questions about iOS outstanding students, can go to the bill of lading to our developers: airtest.netease.com/issue_creat… .


AirtestIDE download: airtest.netease.com/ Airtest tutorial website: airtest.doc.io.netease.com/ build enterprise private cloud service: airlab.163.com/b2b

Official Q group: 654700783