征服iOS自动化测试程序员

使用Xcode Service进行iOS的自动化测试

2014-07-22  本文已影响2715人  不是谢志伟

简介:

About Continuous Integration in Xcode

Xcode supports a continuous integration workflow through the Xcode service. The Xcode service, available in OS X Server, automates the integration process of building, analyzing, testing, and archiving your app. From your development Mac, you create bots that run on a separate server, where they perform these integrations. Bots help ensure that your product is always in a releasable state—and when there’s a failure, the service notifies you or the person whose code change caused the failure.

配置要求

配置步骤

一:OS X Server的配置:

  1. OS X Server app下载链接: http://chinamac.dbank.com/c0ju1oq2du

  2. 安装好OS X Server后,设置Xcode Service

    2.1 设置代码仓库(Repositories),(我的代码仓库是在Github上,我测试的时候使用SSH连接会失败,然后使用HTTPS就正常连接)

    2.2 设置Xcode service的权限(修改Xcode Service Bot的权限等),分三种:
    * 登录用户
    * 任何用户
    * 部分用户
    2.3 开启Xcode service.


    1.pic.jpg

二:Xcode的配置:


2.pic.jpg

到这里 ,OS X Server 的Xcoder Service 还有 Xcode都设置好了.现在可以添加一个Bot来进行自动测试了.


3.pic.jpg

What is Bot:


what is a Bot.png

进行自动化测试之前,首先,我们需要创建一个Bot.
Bot有几种类型:

Bot可以在Xcode或者浏览器管理页面上进行手动触发.

在Xcode的Product -> Create Bot来创建一个Bot.


create a bot.png

Why Xcode Service?

4.pic.jpg

我们使用的是gitlab做代码仓库,在Xcode上配置好OS Server之后,集成的时候会出现权限问题:

debug1: Trying private key: /var/empty/.ssh/id_rsa
debug1: Trying private key: /var/empty/.ssh/id_dsa
debug1: No more authentication methods to try.
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

解决方法是将public key还有private key文件分别移到/var/empty/.ssh/id_rsa , /var/empty/.ssh/id_dsa 目录下.

上一篇下一篇

猜你喜欢

热点阅读