#! /usr/bin/env python3
# -*- coding: utf-8 -*-

import os
import time
from appium import webdriver

desired_caps = {}
desired_caps['automationName'] = 'XCUITest'
# desired_caps['appium-version'] = '1.6.3'
desired_caps['platformName'] = 'iOS'
desired_caps['platformVersion'] = '10.2'
desired_caps['deviceName'] = 'iPhone 6'
desired_caps['autoAcceptAlerts'] = True
desired_caps['noReset'] = True
desired_caps['app'] = os.path.abspath('/Users/tian/Downloads/iOS/HappyWeek.app')
driver = webdriver.Remote('http://0.0.0.0:4723/wd/hub',desired_caps)



debug:

[debug] [XCUITest] WebDriverAgent running on ip '192.168.1.9'
[debug] [XCUITest] WebDriverAgent successfully started after 20962ms
[debug] [XCUITest] Sending createSession command to WDA
[debug] [JSONWP Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"desiredCapabilities":{"bundleId":"com.kumi.HappyWeek","arguments":[],"environment":{},"shouldWaitForQuiescence":true}}
[debug] [JSONWP Proxy] Got response with status 200: {"value":"Failed to launch com.kumi.HappyWeek application","sessionId":"14B9AF96-E2B0-4E90-955A-294ADA2F46EB","status":13}
[debug] [XCUITest] Failed to create WDA session. Retrying...
[debug] [XCUITest] Sending createSession command to WDA
[debug] [JSONWP Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"desiredCapabilities":{"bundleId":"com.kumi.HappyWeek","arguments":[],"environment":{},"shouldWaitForQuiescence":true}}
 [debug] [JSONWP Proxy] Got response with status 200: {"value":"Failed to launch com.kumi.HappyWeek application","sessionId":"14B9AF96-E2B0-4E90-955A-294ADA2F46EB","status":13}
[debug] [XCUITest] Failed to create WDA session. Retrying...
[debug] [XCUITest] Sending createSession command to WDA
[debug] [JSONWP Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"desiredCapabilities":{"bundleId":"com.kumi.HappyWeek","arguments":[],"environment":{},"shouldWaitForQuiescence":true}}
 [debug] [JSONWP Proxy] Got response with status 200: {"value":"Failed to launch com.kumi.HappyWeek application","sessionId":"14B9AF96-E2B0-4E90-955A-294ADA2F46EB","status":13}
[debug] [XCUITest] Failed to create WDA session. Retrying...
[debug] [XCUITest] Sending createSession command to WDA
[debug] [JSONWP Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"desiredCapabilities":{"bundleId":"com.kumi.HappyWeek","arguments":[],"environment":{},"shouldWaitForQuiescence":true}}
 [debug] [JSONWP Proxy] Got response with status 200: {"value":"Failed to launch com.kumi.HappyWeek application","sessionId":"14B9AF96-E2B0-4E90-955A-294ADA2F46EB","status":13}
[debug] [XCUITest] Failed to create WDA session. Retrying...
[debug] [XCUITest] Sending createSession command to WDA
[debug] [JSONWP Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"desiredCapabilities":{"bundleId":"com.kumi.HappyWeek","arguments":[],"environment":{},"shouldWaitForQuiescence":true}}

xcode-8.2.1
appium-1.6.4-beta


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