为了弄这个真机的测试,一个周末就过去了,特别对不起我孩子,本来一周就只有一天能陪他了,还被我占用了。当成功打开被测 app 的那一瞬间,心里是很欣慰的。写下此文希望可以帮助到准备跳坑的和还在坑里的朋友。如果觉得有用,请点个赞!!

一、 准备

二、 环境安装

Node.js checklist:

node env: /usr/local/bin/node
node version: v4.5.0

iOS checklist:

Xcode is installed at: /Library/Developer/CommandLineTools
Xcode Command Line Tools is ready, version: 2343.
ios_webkit_debug_proxy is installed at: /usr/local/bin/ios_webkit_debug_proxy

Android checklist:

JAVA version is 1.8.0_101
JAVA_HOME is set to /Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home
ANDROID_HOME is not set

Installed driver list:

ios: 1.0.36


三、iOS模拟器运行测试
-----

 - **运行测试**

```shell
cd /macaca-test-sample-master/macaca-test/
macaca run -d macaca-mobile-sample.test.js

四、iOS 真机运行测试(用 java 代码演示 ios-app-bootstrap)

1. 打开 webdriveragent 项目

2. Xcode 中添加 AppleID

Xcode--Prefencens--Accounts

3. 创建 iOS Development Singing Identities

Accounts--View Details--iOS Development—Create

4. 给 webdriveragentrunner 重签名

修改 webdriveragentrunner Product Bundle Identifier

然后 Build 一下,如果 Build Successed 那么就 OK 了,如果 Build 过程中提示有 Fix issue 点击它即可。

运行一次测试 webdriveragentrunner 就会按照到手机上。

macaca server –verbose  
@Before  
    public void setUp() throws Exception {
        JSONObject porps = new JSONObject();
        porps.put("autoAcceptAlerts", true);
        porps.put("deviceName", "iPhone 6s");
        porps.put("platformName", "iOS");
        porps.put("version", "9.3.4");
        porps.put("udid", "your udid");
        porps.put("bundleId", "zx.ios-app-bootstrap");
        JSONObject desiredCapabilities = new JSONObject();
        desiredCapabilities.put("desiredCapabilities", porps);
        driver.initDriver(desiredCapabilities);
        driver.sleep(20000);
    }


5. 给 ios-app-bootstrap 重签名

brew intall Carthage
cd /ios-app-bootstrap-master
carthage update

修改 Product Bundle Identifier

此时手机上就会有刚才构建的 ios-app-bootstrap(已经信任过该 AppleID 了,不会出现需要信任的情况)

6. 运行测试

@Before
public void setUp() throws Exception {
    JSONObject porps = new JSONObject();
    porps.put("autoAcceptAlerts", true);
    porps.put("deviceName", "iPhone 6s");
    porps.put("platformName", "iOS");
    porps.put("version", "9.3.4");
    porps.put("udid", "your udid");
    porps.put("bundleId", "zx.ios-app-bootstrap");
    //      porps.put("app", "/Users/qian/Documents/workspace/wd.java/app/dev_Test.ipa");
    JSONObject desiredCapabilities = new JSONObject();
    desiredCapabilities.put("desiredCapabilities", porps);
    driver.initDriver(desiredCapabilities);
    driver.sleep(20000);
}

@Test
public void test_case_1() throws Exception {
    driver.saveScreenshot("/Users/qian/Documents/workspace/wd.java/app/xx.jpg");
    driver.sleep(2000);
    String str = driver.source();
    System.out.println(str);
}
qiandeMac:~ qian$ macaca server --verbose
>> index.js:17:12 [master] pid:386 webdriver server start with config:
 { port: 3456,
  verbose: true,
  always: true,
  ip: '192.168.1.102',
  host: 'qiandeMac.local',
  loaded_time: '2016-08-28 20:57:47' }
>> middlewares.js:17:10 [master] pid:386 base middlewares attached
>> router.js:108:10 [master] pid:386 router set
>> webdriver sdk launched
>> responseHandler.js:11:12 [master] pid:386 Recieve HTTP Request from Client: method: POST url: /wd/hub/session, jsonBody: {"desiredCapabilities":{"bundleId":"zx.ios-app-bootstrap","platformName":"iOS","udid":"your udid","deviceName":"iPhone 6s","version":"9.3.4","autoAcceptAlerts":true}}
>> session.js:47:10 [master] pid:386 Creating session, sessionId: 848a07c9-d475-4658-8690-c603925ed568.
>> xctest-client.js:43:14 [master] pid:386 project path: /usr/local/lib/node_modules/.macaca-ios_npminstall/node_modules/.1.0.22@webdriveragent/WebDriverAgent/WebDriverAgent.xcodeproj
>> macaca-ios.js:130:10 [master] pid:386 {
    "bundleId": "zx.ios-app-bootstrap",
    "platformName": "iOS"
}
>> xctest-client.js:182:12 [master] pid:386 xcode version: 7.3.1
>> xctest-client.js:123:16 [master] pid:386 Waiting for device with UDID your udid to become available...

>> xctest-client.js:155:14 [master] pid:386 2016-08-28 20:59:39.582 xcodebuild[397:4875] [MT] IDETestOperationsObserverDebug: (82E2184B-BB33-473F-8012-3779E90EAEEE) Beginning test session 82E2184B-BB33-473F-8012-3779E90EAEEE with Xcode 7D1014 on target <DVTiOSDevice: 0x7fe2d4f93180> {
        deviceSerialNumber:         C6KQX25WGRY6
        identifier:                 your udid
        deviceClass:                iPhone
        deviceName:                 “qian”的 iPhone
        deviceIdentifier:           your udid
        productVersion:             9.3.4
        buildVersion:               13G35
        deviceSoftwareVersion:      9.3.4 (13G35)
        deviceArchitecture:         arm64
        deviceTotalCapacity:        12628783104
        deviceAvailableCapacity:    1510371328
        deviceIsTransient:          NO
        ignored:                    NO
        deviceIsBusy:               NO
        deviceIsActivated:          YES
        deviceActivationState:      Activated
        deviceType:                 <DVTDeviceType:0x7fe2d4bb1ef0 Xcode.DeviceType.iPhone>
        supportedDeviceFamilies:    (
    1
)
        applications:              (null)
        provisioningProfiles:      (null)
        activityProgress:          -2
        activityTitle:             
        hasInternalSupport:        NO
        isSupportedOS:             YES
        developerDiskMountError:   (null)
(null)
    } (9.3.4 (13G35))

>> xctest-client.js:155:14 [master] pid:386 2016-08-28 20:59:39.583 xcodebuild[397:5071]  IDETestOperationsObserverDebug: Writing diagnostic log for test session to:
/Users/qian/Library/Developer/Xcode/DerivedData/WebDriverAgent-ecncypxshfwjehdvedwmpomonice/Logs/Test/4EFCB4AB-5AC4-40F0-AC28-C5B65543F847/Session-2016-08-28_20:59:39-vCJ2pD.log

>> xctest-client.js:155:14 [master] pid:386 MDMCreateDeltaDirectory:1920 calling MDMDirectoryDiff with:
state->old_bundle: /var/folders/gq/6nz6r9bj5hvd0n4pr8htrpd80000gn/C/com.apple.DeveloperTools/All/Xcode/EmbeddedAppDeltas/eadba4ed1c4e510e31a10da1b512ad82/your udid/WebDriverAgentRunner-Runner.app
state->new_bundle: /Users/qian/Library/Developer/Xcode/DerivedData/WebDriverAgent-ecncypxshfwjehdvedwmpomonice/Build/Products/Debug-iphoneos/WebDriverAgentRunner-Runner.app
state->dst_bundle: /var/folders/gq/6nz6r9bj5hvd0n4pr8htrpd80000gn/C/com.apple.DeveloperTools/All/Xcode/EmbeddedAppDeltas/WebDriverAgentRunner-Runner.app.gAeiGg/WebDriverAgentRunner-Runner.app_sparse.ipa/Payload//WebDriverAgentRunner-Runner.app, binaryDiff flag: FALSE
    dst_ipa: /var/folders/gq/6nz6r9bj5hvd0n4pr8htrpd80000gn/C/com.apple.DeveloperTools/All/Xcode/EmbeddedAppDeltas/WebDriverAgentRunner-Runner.app.gAeiGg/WebDriverAgentRunner-Runner.app_sparse.ipa

>> xctest-client.js:155:14 [master] pid:386 __MDMDirectoryDiff_block_invoke37:1473 calling writeDictToFile with: /var/folders/gq/6nz6r9bj5hvd0n4pr8htrpd80000gn/C/com.apple.DeveloperTools/All/Xcode/EmbeddedAppDeltas/WebDriverAgentRunner-Runner.app.gAeiGg/WebDriverAgentRunner-Runner.app_sparse.ipa/ManifestCache.plist

>> xctest-client.js:155:14 [master] pid:386 writeDictToFile:1278 ==== Successfully wrote Manifest cache to /var/folders/gq/6nz6r9bj5hvd0n4pr8htrpd80000gn/C/com.apple.DeveloperTools/All/Xcode/EmbeddedAppDeltas/WebDriverAgentRunner-Runner.app.gAeiGg/WebDriverAgentRunner-Runner.app_sparse.ipa/ManifestCache.plist

>> proxy.js:54:14 [master] pid:386 Proxy: /session:POST to http://192.168.1.101:8100/session:POST with body: {"desiredCapabilities":{"bundleId":"zx.ios-app-bootstrap","platformName":"iOS"}}
>> proxy.js:67:16 [master] pid:386 Got response with status 200: {"value":{"sessionId":"B9C774C6-D4C0-499D-853E-8FDFB93F4E04","capabilities":{"device":"iphone","browserName":"ios-app-bootstrap","sdkVersion":"9.3.4","CFBundleIdentifier":"zx.ios-app-bootstrap"}},"...
>> responseHandler.js:43:14 [master] pid:386 Send HTTP Respone to Client: {"sessionId":"848a07c9-d475-4658-8690-c603925ed568","status":0,"value":"{\"bundleId\":\"zx.ios-app-bootstrap\",\"platformName\":\"iOS\",\"udid\":\"your udid\",\"deviceName\":\"iPhone 6s\",\"version\":\"9.3.4\",\"autoAcceptAlerts\":true}"}
>> responseHandler.js:11:12 [master] pid:386 Recieve HTTP Request from Client: method: POST url: /wd/hub/session/848a07c9-d475-4658-8690-c603925ed568/timeouts/implicit_wait, jsonBody: {"ms":20000}
>> responseHandler.js:43:14 [master] pid:386 Send HTTP Respone to Client: {"sessionId":"848a07c9-d475-4658-8690-c603925ed568","status":0,"value":null}
>> responseHandler.js:11:12 [master] pid:386 Recieve HTTP Request from Client: method: GET url: /wd/hub/session/848a07c9-d475-4658-8690-c603925ed568/screenshot, jsonBody: {}
>> proxy.js:54:14 [master] pid:386 Proxy: /wd/hub/session/848a07c9-d475-4658-8690-c603925ed568/screenshot:GET to http://192.168.1.101:8100/session/B9C774C6-D4C0-499D-853E-8FDFB93F4E04/screenshot:GET with body: 
>> proxy.js:67:16 [master] pid:386 Got response with status 200: "{\n  \"value\" : \"iVBORw0KGgoAAAANSUhEUgAAAu4AAAU2CAYAAADK1zMGAAAAAXNSR0IArs4c6QAA\\r\\nABxpRE9UAAAAAgAAAAAAAAKbAAAAKAAAApsAAAKbAABu\\/iDeuP8AAEAASURBVHgB\\r\\n7N2Jvy1pXd\\/7DSgyqDihGGdUBBwQERPnC...
>> responseHandler.js:43:14 [master] pid:386 Send HTTP Respone to Client: {"sessionId":"848a07c9-d475-4658-8690-c603925ed568","status":0,"value":"\"iVBORw0KGgoAAAANSUhEUgAAAu4AAAU2CAYAAADK1zMGAAAAAXNSR0IArs4c6QAA\\r\\nABxpRE9UAAAAAgAAAAAAAAKbAAAAKAAAApsAAAKbAABu/iDeuP8AAEAASURBVHgB\\r\\n7N2Jvy1pXd/7DSgyqDihGGdUBBwQERPnCROMaERR40TiQMSYOCUxaoyzcQAEmRS6\\r\\nm2YUGhAQGwTBoMnNvfEm997E5JWX+WdYtz57dXVXr7PWPtPeveo5+31er/Va++w1\\r\\nVT3Pu6q+v6eeVftk458W0AJaQAtc0QIf/OAHN936t+/n+Xf77nffbPmc3cf8Xwto\\r\\nAS2gBbTAtbbAyfzEk/f/z42bNmCAAQYYYIABBhhgYKUGBPeVdoxCSiHJ..."}
>> responseHandler.js:11:12 [master] pid:386 Recieve HTTP Request from Client: method: POST url: /wd/hub/session/848a07c9-d475-4658-8690-c603925ed568/timeouts/implicit_wait, jsonBody: {"ms":2000}
>> responseHandler.js:43:14 [master] pid:386 Send HTTP Respone to Client: {"sessionId":"848a07c9-d475-4658-8690-c603925ed568","status":0,"value":null}
>> responseHandler.js:11:12 [master] pid:386 Recieve HTTP Request from Client: method: GET url: /wd/hub/session/848a07c9-d475-4658-8690-c603925ed568/source, jsonBody: {}
>> proxy.js:54:14 [master] pid:386 Proxy: /wd/hub/session/848a07c9-d475-4658-8690-c603925ed568/source:GET to http://192.168.1.101:8100/session/B9C774C6-D4C0-499D-853E-8FDFB93F4E04/source:GET with body: {}
>> proxy.js:67:16 [master] pid:386 Got response with status 200: "{\n  \"value\" : {\n    \"tree\" : {\n      \"bounds\" : \"{{0, 0}, {375, 667}}\",\n      \"isEnabled\" : \"1\",\n      \"isVisible\" : \"1\",\n      \"children\" : [\n        {\n          \"bound...
>> session.js:107:14 [master] pid:386 Send HTTP Respone to Client: "{\n  \"value\" : {\n    \"tree\" : {\n      \"bounds\" : \"{{0, 0}, {375, 667}}\",\n      \"isEnabled\" : \"1\",\n      \"isVisible\" : \"1\",\n      \"children\" : [\n        {\n          \"bounds\" : \"{{0, 0}, {375, 667}}\",\n          \"isEnabled\" : \"1\",\n          \"isVisible\" : \"1\",\n          \"children\" : [\n            {\n              \"bounds\" : \"{{0, 0}, {375, 667}}\",\n              \"isEnabled\" : \"1\",\n              \"isVisible\" : \"1\",\n              \"children\" : [\n                {\n                  \"bounds\" : \"{{0, 0}, {375, 667}}\",\n                  \"isEnabled\" : \"1\",\n                  \"isVisible\" : \"1\",\n                  \"children\" : [\n                    {\n                      \"bounds\" : \"{{0, 0}, {375, 667}}\",\n                      \"isEnabled\" : \"1\",\n                      \"isVisible\" : \"1\",\n                      \"children\" : [\n                        {\n                          \"bounds\" : \"{{0, 0}, {375, 667}}\",\n                          \"isEnabled\" : \"1\",\n                          \"isVisible\" : \"1\",\n                          \"children\" : [\n                            {\n                              \"bounds\" : \"{{16, 100}, {343, 20}}\",\n                              \"isEnabled\" : \"1\",\n                              \"isVisible\" : \"1\",\n                              \"rect\" : {\n                                \"origin\" : {\n                                  \"x\" : 16,\n                                  \"y\" : 100\n                                },\n                                \"size\" : {\n                                  \"width\" : 343,\n                                  \"height\" : 20\n                                }\n                              },\n                              \"value\" : \"iOS Bootstrap\",\n                              \"label\" : \"iOS Bootstrap\",\n                              \"type\" : \"StaticText\",\n                              \"name\" : \"iOS Bootstrap\",\n                              \"rawIdentifier\" : null\n                            },\n                            {\n                              \"bounds\" : \"{{16, 150}, {343, 50}}\",\n                              \"isEnabled\" : \"1\",\n                              \"isVisible\" : \"1\",\n                              \"rect\" : {\n                                \"origin\" : {\n                                  \"x\" : 16,\n                                  \"y\" : 150\n                                },\n                                \"size\" : {\n                                  \"width\" : 343,\n                                  \"height\" : 50\n                                }\n                              },\n                              \"value\" : \"please input username\",\n                              \"label\" : \"\",\n                              \"type\" : \"TextField\",\n                              \"name\" : null,\n                              \"rawIdentifier\" : null\n                            },\n                            {\n                              \"bounds\" : \"{{16, 210}, {343, 50}}\",\n                              \"isEnabled\" : \"1\",\n                              \"isVisible\" : \"1\",\n                              \"rect\" : {\n                                \"origin\" : {\n                                  \"x\" : 16,\n                                  \"y\" : 210\n                                },\n                                \"size\" : {\n                                  \"width\" : 343,\n                                  \"height\" : 50\n                                }\n                              },\n                              \"value\" : \"please input password\",\n                              \"label\" : null,\n                              \"type\" : \"SecureTextField\",\n                              \"name\" : null,\n                              \"rawIdentifier\" : null\n                            },\n                            {\n                              \"bounds\" : \"{{16, 527}, {343, 40}}\",\n                              \"isEnabled\" : \"1\",\n                              \"isVisible\" : \"1\",\n                              \"rect\" : {\n                                \"origin\" : {\n                                  \"x\" : 16,\n                                  \"y\" : 527\n                                },\n                                \"size\" : {\n                                  \"width\" : 343,\n                                  \"height\" : 40\n                                }\n                              },\n                              \"value\" : null,\n                              \"label\" : \"Login\",\n                              \"type\" : \"Button\",\n                              \"name\" : \"Login\",\n                              \"rawIdentifier\" : null\n                            }\n                          ],\n                          \"rect\" : {\n                            \"origin\" : {\n                              \"x\" : 0,\n                              \"y\" : 0\n                            },\n                            \"size\" : {\n                              \"width\" : 375,\n                              \"height\" : 667\n                            }\n                          },\n                          \"value\" : null,\n                          \"label\" : null,\n                          \"type\" : \"Other\",\n                          \"name\" : null,\n                          \"rawIdentifier\" : null\n                        }\n                      ],\n                      \"rect\" : {\n                        \"origin\" : {\n                          \"x\" : 0,\n                          \"y\" : 0\n                        },\n                        \"size\" : {\n                          \"width\" : 375,\n                          \"height\" : 667\n                        }\n                      },\n                      \"value\" : null,\n                      \"label\" : null,\n                      \"type\" : \"Other\",\n                      \"name\" : null,\n                      \"rawIdentifier\" : null\n                    }\n                  ],\n                  \"rect\" : {\n                    \"origin\" : {\n                      \"x\" : 0,\n                      \"y\" : 0\n                    },\n                    \"size\" : {\n                      \"width\" : 375,\n                      \"height\" : 667\n                    }\n                  },\n                  \"value\" : null,\n                  \"label\" : null,\n                  \"type\" : \"Other\",\n                  \"name\" : null,\n                  \"rawIdentifier\" : null\n                },\n                {\n                  \"bounds\" : \"{{0, 667}, {375, 44}}\",\n                  \"isEnabled\" : \"1\",\n                  \"isVisible\" : \"0\",\n                  \"children\" : [\n                    {\n                      \"bounds\" : \"{{0, 666.5}, {375, 0.5}}\",\n                      \"isEnabled\" : \"1\",\n                      \"isVisible\" : \"0\",\n                      \"rect\" : {\n                        \"origin\" : {\n                          \"x\" : 0,\n                          \"y\" : 666.5\n                        },\n                        \"size\" : {\n                          \"width\" : 375,\n                          \"height\" : 0.5\n                        }\n                      },\n                      \"value\" : null,\n                      \"label\" : null,\n                      \"type\" : \"Image\",\n                      \"name\" : null,\n                      \"rawIdentifier\" : null\n                    },\n                    {\n                      \"bounds\" : \"{{0, 667}, {375, 44}}\",\n                      \"isEnabled\" : \"1\",\n                      \"isVisible\" : \"0\",\n                      \"children\" : [\n                        {\n                          \"bounds\" : \"{{0, 667}, {375, 44}}\",\n                          \"isEnabled\" : \"1\",\n                          \"isVisible\" : \"0\",\n                          \"children\" : [\n                            {\n                              \"bounds\" : \"{{0, 667}, {375, 44}}\",\n                              \"isEnabled\" : \"1\",\n                              \"isVisible\" : \"0\",\n                              \"rect\" : {\n                                \"origin\" : {\n                                  \"x\" : 0,\n                                  \"y\" : 667\n                                },\n                                \"size\" : {\n                                  \"width\" : 375,\n                                  \"height\" : 44\n                                }\n                              },\n                              \"value\" : null,\n                              \"label\" : null,\n                              \"type\" : \"Other\",\n                              \"name\" : null,\n                              \"rawIdentifier\" : null\n                            },\n                            {\n                              \"bounds\" : \"{{0, 667}, {375, 44}}\",\n                              \"isEnabled\" : \"1\",\n                              \"isVisible\" : \"0\",\n                              \"rect\" : {\n                                \"origin\" : {\n                                  \"x\" : 0,\n                                  \"y\" : 667\n                                },\n                                \"size\" : {\n                                  \"width\" : 375,\n                                  \"height\" : 44\n                                }\n                              },\n                              \"value\" : null,\n                              \"label\" : null,\n                              \"type\" : \"Other\",\n                              \"name\" : null,\n                              \"rawIdentifier\" : null\n                            }\n                          ],\n                          \"rect\" : {\n                            \"origin\" : {\n                              \"x\" : 0,\n                              \"y\" : 667\n                            },\n                            \"size\" : {\n                              \"width\" : 375,\n                              \"height\" : 44\n                            }\n                          },\n                          \"value\" : null,\n                          \"label\" : null,\n                          \"type\" : \"Other\",\n                          \"name\" : null,\n                          \"rawIdentifier\" : null\n                        }\n                      ],\n                      \"rect\" : {\n                        \"origin\" : {\n                          \"x\" : 0,\n                          \"y\" : 667\n                        },\n                        \"size\" : {\n                          \"width\" : 375,\n                          \"height\" : 44\n                        }\n                      },\n                      \"value\" : null,\n                      \"label\" : null,\n                      \"type\" : \"Image\",\n                      \"name\" : null,\n                      \"rawIdentifier\" : null\n                    }\n                  ],\n                  \"rect\" : {\n                    \"origin\" : {\n                      \"x\" : 0,\n                      \"y\" : 667\n                    },\n                    \"size\" : {\n                      \"width\" : 375,\n                      \"height\" : 44\n                    }\n                  },\n                  \"value\" : null,\n                  \"label\" : null,\n                  \"type\" : \"Toolbar\",\n                  \"name\" : null,\n                  \"rawIdentifier\" : null\n                }\n              ],\n              \"rect\" : {\n                \"origin\" : {\n                  \"x\" : 0,\n                  \"y\" : 0\n                },\n                \"size\" : {\n                  \"width\" : 375,\n                  \"height\" : 667\n                }\n              },\n              \"value\" : null,\n              \"label\" : null,\n              \"type\" : \"Other\",\n              \"name\" : null,\n              \"rawIdentifier\" : null\n            }\n          ],\n          \"rect\" : {\n            \"origin\" : {\n              \"x\" : 0,\n              \"y\" : 0\n            },\n            \"size\" : {\n              \"width\" : 375,\n              \"height\" : 667\n            }\n          },\n          \"value\" : null,\n          \"label\" : null,\n          \"type\" : \"Window\",\n          \"name\" : null,\n          \"rawIdentifier\" : null\n        },\n        {\n          \"bounds\" : \"{{0, 0}, {375, 667}}\",\n          \"isEnabled\" : \"1\",\n          \"isVisible\" : \"0\",\n          \"children\" : [\n            {\n              \"bounds\" : \"{{0, 0}, {375, 667}}\",\n              \"isEnabled\" : \"1\",\n              \"isVisible\" : \"0\",\n              \"children\" : [\n                {\n                  \"bounds\" : \"{{0, 667}, {375, 0}}\",\n                  \"isEnabled\" : \"1\",\n                  \"isVisible\" : \"0\",\n                  \"rect\" : {\n                    \"origin\" : {\n                      \"x\" : 0,\n                      \"y\" : 667\n                    },\n                    \"size\" : {\n                      \"width\" : 375,\n                      \"height\" : 0\n                    }\n                  },\n                  \"value\" : null,\n                  \"label\" : null,\n                  \"type\" : \"Other\",\n                  \"name\" : null,\n                  \"rawIdentifier\" : null\n                }\n              ],\n              \"rect\" : {\n                \"origin\" : {\n                  \"x\" : 0,\n                  \"y\" : 0\n                },\n                \"size\" : {\n                  \"width\" : 375,\n                  \"height\" : 667\n                }\n              },\n              \"value\" : null,\n              \"label\" : null,\n              \"type\" : \"Other\",\n              \"name\" : null,\n              \"rawIdentifier\" : null\n            }\n          ],\n          \"rect\" : {\n            \"origin\" : {\n              \"x\" : 0,\n              \"y\" : 0\n            },\n            \"size\" : {\n              \"width\" : 375,\n              \"height\" : 667\n            }\n          },\n          \"value\" : null,\n          \"label\" : null,\n          \"type\" : \"Window\",\n          \"name\" : null,\n          \"rawIdentifier\" : null\n        },\n        {\n          \"bounds\" : \"{{0, 0}, {375, 667}}\",\n          \"isEnabled\" : \"1\",\n          \"isVisible\" : \"1\",\n          \"children\" : [\n            {\n              \"bounds\" : \"{{0, 0}, {375, 20}}\",\n              \"isEnabled\" : \"1\",\n              \"isVisible\" : \"1\",\n              \"children\" : [\n                {\n                  \"bounds\" : \"{{0, 0}, {375, 20}}\",\n                  \"isEnabled\" : \"1\",\n                  \"isVisible\" : \"0\",\n                  \"rect\" : {\n                    \"origin\" : {\n                      \"x\" : 0,\n                      \"y\" : 0\n                    },\n                    \"size\" : {\n                      \"width\" : 375,\n                      \"height\" : 20\n                    }\n                  },\n                  \"value\" : null,\n                  \"label\" : null,\n                  \"type\" : \"Other\",\n                  \"name\" : null,\n                  \"rawIdentifier\" : null\n                },\n                {\n                  \"bounds\" : \"{{0, 0}, {375, 20}}\",\n                  \"isEnabled\" : \"1\",\n                  \"isVisible\" : \"1\",\n                  \"children\" : [\n                    {\n                      \"bounds\" : \"{{6, 0}, {35, 20}}\",\n                      \"isEnabled\" : \"1\",\n                      \"isVisible\" : \"1\",\n                      \"rect\" : {\n                        \"origin\" : {\n                          \"x\" : 6,\n                          \"y\" : 0\n                        },\n                        \"size\" : {\n                          \"width\" : 35,\n                          \"height\" : 20\n                        }\n                      },\n                      \"value\" : null,\n                      \"label\" : \"2 of 5 bars, signal strength\",\n                      \"type\" : \"Other\",\n                      \"name\" : \"2 of 5 bars, signal strength\",\n                      \"rawIdentifier\" : null\n                    },\n                    {\n                      \"bounds\" : \"{{44, 0}, {48, 20}}\",\n                      \"isEnabled\" : \"1\",\n                      \"isVisible\" : \"1\",\n                      \"rect\" : {\n                        \"origin\" : {\n                          \"x\" : 44,\n                          \"y\" : 0\n                        },\n                        \"size\" : {\n                          \"width\" : 48,\n                          \"height\" : 20\n                        }\n                      },\n                      \"value\" : null,\n                      \"label\" : \"中国电信 network\",\n                      \"type\" : \"Other\",\n                      \"name\" : \"中国电信 network\",\n                      \"rawIdentifier\" : null\n                    },\n                    {\n                      \"bounds\" : \"{{97, 0}, {13, 20}}\",\n                      \"isEnabled\" : \"1\",\n                      \"isVisible\" : \"1\",\n                      \"rect\" : {\n                        \"origin\" : {\n                          \"x\" : 97,\n                          \"y\" : 0\n                        },\n                        \"size\" : {\n                          \"width\" : 13,\n                          \"height\" : 20\n                        }\n                      },\n                      \"value\" : \"SSID\",\n                      \"label\" : \"3 of 3 WLAN bars\",\n                      \"type\" : \"Other\",\n                      \"name\" : \"3 of 3 WLAN bars\",\n                      \"rawIdentifier\" : null\n                    },\n                    {\n                      \"bounds\" : \"{{163, 0}, {52, 20}}\",\n                      \"isEnabled\" : \"1\",\n                      \"isVisible\" : \"1\",\n                      \"rect\" : {\n                        \"origin\" : {\n                          \"x\" : 163,\n                          \"y\" : 0\n                        },\n                        \"size\" : {\n                          \"width\" : 52,\n                          \"height\" : 20\n                        }\n                      },\n                      \"value\" : null,\n                      \"label\" : \"下午9:00\",\n                      \"type\" : \"Other\",\n                      \"name\" : \"下午9:00\",\n                      \"rawIdentifier\" : null\n                    },\n                    {\n                      \"bounds\" : \"{{270, 0}, {12, 20}}\",\n                      \"isEnabled\" : \"1\",\n                      \"isVisible\" : \"1\",\n                      \"rect\" : {\n                        \"origin\" : {\n                          \"x\" : 270,\n                          \"y\" : 0\n                        },\n                        \"size\" : {\n                          \"width\" : 12,\n                          \"height\" : 20\n                        }\n                      },\n                      \"value\" : null,\n                      \"label\" : \"Orientation Locked\",\n                      \"type\" : \"Other\",\n                      \"name\" : \"Orientation Locked\",\n                      \"rawIdentifier\" : null\n                    },\n                    {\n                      \"bounds\" : \"{{288, 0}, {9, 20}}\",\n                      \"isEnabled\" : \"1\",\n                      \"isVisible\" : \"1\",\n                      \"rect\" : {\n                        \"origin\" : {\n                          \"x\" : 288,\n                          \"y\" : 0\n                        },\n                        \"size\" : {\n                          \"width\" : 9,\n                          \"height\" : 20\n                        }\n                      },\n                      \"value\" : null,\n                      \"label\" : \"Location tracking on\",\n                      \"type\" : \"Other\",\n                      \"name\" : \"StandardLocationTrackingOn\",\n                      \"rawIdentifier\" : \"StandardLocationTrackingOn\"\n                    },\n                    {\n                      \"bounds\" : \"{{303, 0}, {67, 20}}\",\n                      \"isEnabled\" : \"1\",\n                      \"isVisible\" : \"1\",\n                      \"rect\" : {\n                        \"origin\" : {\n                          \"x\" : 303,\n                          \"y\" : 0\n                        },\n                        \"size\" : {\n                          \"width\" : 67,\n                          \"height\" : 20\n                        }\n                      },\n                      \"value\" : null,\n                      \"label\" : \"100% battery power, On AC Power\",\n                      \"type\" : \"Other\",\n                      \"name\" : \"100% battery power, On AC Power\",\n                      \"rawIdentifier\" : null\n                    },\n                    {\n                      \"bounds\" : \"{{303, 0}, {31, 20}}\",\n                      \"isEnabled\" : \"1\",\n                      \"isVisible\" : \"1\",\n                      \"rect\" : {\n                        \"origin\" : {\n                          \"x\" : 303,\n                          \"y\" : 0\n                        },\n                        \"size\" : {\n                          \"width\" : 31,\n                          \"height\" : 20\n                        }\n                      },\n                      \"value\" : null,\n                      \"label\" : \"100% battery power\",\n                      \"type\" : \"Other\",\n                      \"name\" : \"100% battery power\",\n                      \"rawIdentifier\" : null\n                    }\n                  ],\n                  \"rect\" : {\n                    \"origin\" : {\n                      \"x\" : 0,\n                      \"y\" : 0\n                    },\n                    \"size\" : {\n                      \"width\" : 375,\n                      \"height\" : 20\n                    }\n                  },\n                  \"value\" : null,\n                  \"label\" : null,\n                  \"type\" : \"Other\",\n                  \"name\" : null,\n                  \"rawIdentifier\" : null\n                }\n              ],\n              \"rect\" : {\n                \"origin\" : {\n                  \"x\" : 0,\n                  \"y\" : 0\n                },\n                \"size\" : {\n                  \"width\" : 375,\n                  \"height\" : 20\n                }\n              },\n              \"value\" : null,\n              \"label\" : null,\n              \"type\" : \"StatusBar\",\n              \"name\" : null,\n              \"rawIdentifier\" : null\n            }\n          ],\n          \"rect\" : {\n            \"origin\" : {\n              \"x\" : 0,\n              \"y\" : 0\n            },\n            \"size\" : {\n              \"width\" : 375,\n              \"height\" : 667\n            }\n          },\n          \"value\" : null,\n          \"label\" : null,\n          \"type\" : \"Window\",\n          \"name\" : null,\n          \"rawIdentifier\" : null\n        }\n      ],\n      \"rect\" : {\n        \"origin\" : {\n          \"x\" : 0,\n          \"y\" : 0\n        },\n        \"size\" : {\n          \"width\" : 375,\n          \"height\" : 667\n        }\n      },\n      \"value\" : null,\n      \"label\" : \"ios-app-bootstrap\",\n      \"type\" : \"Application\",\n      \"name\" : \"ios-app-bootstrap\",\n      \"rawIdentifier\" : null\n    }\n  },\n  \"sessionId\" : \"B9C774C6-D4C0-499D-853E-8FDFB93F4E04\",\n  \"status\" : 0\n}"
>> responseHandler.js:11:12 [master] pid:386 Recieve HTTP Request from Client: method: DELETE url: /wd/hub/session/848a07c9-d475-4658-8690-c603925ed568, jsonBody: {}
>> macaca-ios.js:258:10 [master] pid:386 Stoping iOS driver...
>> macaca-ios.js:284:10 [master] pid:386 iOS driver cleaned up.
>> session.js:80:12 [master] pid:386 Delete session, sessionId: 848a07c9-d475-4658-8690-c603925ed568
>> responseHandler.js:43:14 [master] pid:386 Send HTTP Respone to Client: {"sessionId":"848a07c9-d475-4658-8690-c603925ed568","status":0}
>> xctest-client.js:123:16 [master] pid:386 
Exiting...

>> xctest-client.js:131:16 [master] pid:386 bootstrap exit with code: 0, signal: null
>> xctest-client.js:155:14 [master] pid:386 ** BUILD INTERRUPTED **

>> xctest-client.js:163:14 [master] pid:386 xctest client exit with code: null, signal: SIGTERM


↙↙↙阅读原文可查看相关链接,并与作者交流