MonkeyTalk自动化之——IOS agent

来源:互联网 发布:ipv6网络设计 编辑:程序博客网 时间:2024/05/17 23:10

     本文主要讲解如何创建IOS agent, 参考官网http://www.cloudmonkeymobile.com/monkeytalk-documentation/monkeytalk-getting-started/install-agent/ios

Installing the MonkeyTalk iOS Agent

1.  Download and unzip the MonkeyTalk zip file for your OS.

点击Download连接,即可下载MonkeyTalk压缩包, 或者使用已有的MonkeyTalk文件

2.  Open your application's project in Xcode.

在Xcode编辑器中打开写好的IOS工程

第三步仅为重命名工程,可以忽略

3. Duplicate your application's build target by right-clicking on it and selectingDuplicate from the menu. A new target will be created called YourApp copy.

Rename YourApp copy to something like YourAppMonkey.

so it looks like this:

 

You may also want to rename the Scheme from the Manage Schemes window:

 


4. Add the downloaded MonkeyTalk lib to your projectFile > Add to “YourApp”... from the menu.

在工程中添加MonkeyTalk lib文件

5. When the dialog box appears, navigate to the directory where you unzipped the MonkeyTalk zip file, and select the MonkeyTalk iOS lib frompathToMonkeyTalkFolder/agents/iOS.

查找MonkeyTalk文件夹中的IOS lib文件, 目录为monkeytalkpro\agents\ios\libMonkeyTalk-2.0.5.a

6. Recursively create groups for any added folders option. Note: It is up to you whether or not you want toCopy items into destination group's folder.

此处可以根据图片中的信息进行操作

7. In the Add to Targets box, deselectYourApp and select YourAppMonkey.

选中需要的工程。

8. Click Add.

9. The MonkeyTalk lib should now be visible in your project.

 lib文件添加成功

Configuring Libraries and Build Settings

此处为添加4个库文件

1. Right-click on the YourAppMonkey build target, and select theBuild Phases tab.

2. On the Link Binaries With Libraries tab, you will need to add libstdc++.6.0.9.dylib libsqlite3.dylib CFNetwork.framework andQuartzCore.framework if your application is not already using them. (These frameworks are required by the MonkeyTalk). 

3. XCode will have added references to the libMonkeyTalk.a library. (Note: if you want to build iOS 4.x, make sure you change UIKit.framework from "Required" to "Optional")

此处可以根据实际需要进行操作

4. On the Build Settings tab, scroll down to theLinking section and add to your Other Linker Flags:-all_load

5. Choose your duplicated test target from the Scheme menu in Xcode and Run on the Simulator or Device.


然后,进行打包,并在手机或者模拟器上面运行,这时再通过MonkeyTalk连接,就可以识别我们的agent。


最后,通过以上操作,可以总结为以下三个步骤:

1、添加MonkeyTalk自带的ISO lib文件

2、添加相关的类库

3、设置Other Linker Flags选项


0 0