1

アピウム : 1.4.13

xcode: 7.1

iOS: 9.1

desired_caps = dict()
            desired_caps['platformName'] = 'iOS'
            desired_caps['platformVersion'] = '9.1'
            desired_caps['deviceName'] = 'iPhone 6'
            desired_caps['app'] = os.path.abspath('/Users/Test.app')
            self.driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)

実際のデバイスが接続されていても、常にシミュレーターを起動します。

デバイスで実行しようとしています。

また、シミュレーターは起動とシャットダウンを繰り返します。

info: [debug] Starting command proxy.
info: [debug] Instruments socket server started at /tmp/instruments_sock
info: [debug] Starting instruments
info: [debug] Instruments is at: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments
info: Launching instruments
info: [debug] Attempting to run app on iPhone 6 (9.1) [
info: On xcode 7.0, instruments-without-delay does not work, skippinginstruments-without-delay
info: [debug] Spawning instruments with command: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.xrplugin/Contents/Resources/Automation.tracetemplate -D /tmp/appium-instruments/instrumentscli0.trace -w "iPhone 6 (9.1) [" /Users/Test.app -e UIASCRIPT "/Users/Library/Application Support/appium/bootstrap/bootstrap-bf740a9394e481ef.js" -e UIARESULTSPATH /tmp/appium-instruments
info: [debug] And launch timeouts (in ms): {"global":90000}
info: [debug] [INST] Waiting for device to boot...
info: [debug] [INST STDERR] 2015-10-21 13:29:31.895 instruments[3192:50268] WebKit Threading Violation - initial use of WebKit from a secondary thread.
info: [debug] [INST STDERR] 2015-10-21 13:29:53.976 instruments[3192:50261] Attempting to change event horizon while disengage
info: [debug] [INST STDERR] 2015-10-21 13:29:53.976 instruments[3192:51306] Attempting to change event horizon while disengage
info: [debug] [INST STDERR] Instruments Trace Error : Target failed to run: The operation couldn’t be completed. (FBSOpenApplicationErrorDomain error 1.) : Failed to launch process with bundle identifier 'com.apsalar.sdkBatchTest2'
info: [debug] [INSTSERVER] Instruments exited with code 253
info: [debug] Killall instruments
info: [debug] Instruments crashed on startup
info: [debug] Attempting to retry launching instruments, this is retry #1
info: [debug] Killall Simulator
info: Launching instruments
info: [debug] Attempting to run app on iPhone 6 (9.1) [
info: On xcode 7.0, instruments-without-delay does not work, skippinginstruments-without-delay
info: [debug] Spawning instruments with command: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.xrplugin/Contents/Resources/Automation.tracetemplate -D /tmp/appium-instruments/instrumentscli0.trace -w "iPhone 6 (9.1) [" /Users/Test.app -e UIASCRIPT "/Users/Library/Application Support/appium/bootstrap/bootstrap-bf740a9394e481ef.js" -e UIARESULTSPATH /tmp/appium-instruments
info: [debug] And launch timeouts (in ms): {"global":90000}
info: [debug] [INST STDERR] 2015-10-21 13:30:00.033 instruments[3298:51578] **WebKit Threading Violation - initial use of WebKit from a secondary thread.**
info: [debug] [INST] Waiting for device to boot...
info: [debug] [INST STDERR] 2015-10-21 13:30:07.851 instruments[3298:51576] Attempting to change event horizon while disengage
info: [debug] [INST STDERR] 2015-10-21 13:30:07.851 instruments[3298:51577] Attempting to change event horizon while disengage
info: [debug] [INST STDERR] Instruments Trace Error : Target failed to run: The operation couldn’t be completed. (FBSOpenApplicationErrorDomain error 1.) : Failed to launch process with bundle identifier 'com.apsalar.sdkBatchTest2'
info: [debug] [INSTSERVER] Instruments exited with code 253
info: [debug] Killall instruments
4

3 に答える 3

0

udidの追加が機能しました!!

desired_caps = dict()
            desired_caps['platformName'] = 'iOS'
            desired_caps['platformVersion'] = '9.1'
            desired_caps['deviceName'] = 'iPhone 6'
            desired_caps['udid'] = '09d905a109245efebd23ab741c0900e83769b3ae'
            desired_caps['app'] = os.path.abspath('/Users/Test.app')
            self.driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
于 2015-10-21T21:36:34.357 に答える
0

「udid」機能を追加し、そこにデバイスの udid を入力します。

capabilities.setCapability("deviceName", "phoneUDID");
于 2015-10-21T21:37:20.970 に答える
0

1) まず、iOS デバイス設定の UIAutomation を有効にする > 開発者 > UI 自動化を有効にする

2) 実デバイスの UDID で Appium インスタンスを起動します

のような: ノード。-p 4725 -bp 2553 -U ""

3) 次のようにテスト コードに機能を追加します。

    File rootDir = new File(System.getProperty("user.dir"));
    File appDir = new File(rootDir, "folder");
    File app = new File(appDir, AppName);

    DesiredCapabilities capabilities = new DesiredCapabilities();

    /*Capabilities for Simulator*/
//  capabilities.setCapability("deviceName", "iPhone 6");
    /*Capabilities for Simulator*/

    /*Capabilities for Device*/
    capabilities.setCapability("deviceName", "Wasim~iPhone");
    /*Capabilities for Device*/

    capabilities.setCapability("platformVersion", "9.1");
    capabilities.setCapability("platformName", "iOS");
    capabilities.setCapability("autoAcceptAlerts",true); //this auto accepts the Notification alert

    capabilities.setCapability("platformVersion", "9.1");
    capabilities.setCapability("noReset",true);

    if (isfirstTimeStart) {

        capabilities.setCapability("app", app.getAbsolutePath());

    }else {

        capabilities.setCapability("bundleId", bundleId);

    }

    driver = new AppiumDriver(new URL("http://127.0.0.1:4725/wd/hub"), capabilities);

そのため、Appium サーバー インスタンスを実行する場合は、DeviceName と UDID を Device で実行することが重要です。

于 2015-11-12T13:45:51.157 に答える