从appium运行ios app的问题

时间:2016-06-23 07:44:43

标签: ios appium instruments

我尝试使用appium运行iOS应用程序我已经在互联网上搜索了几个例子,这就是我已经发布的内容:

public class NotAScenario {

    IOSDriver driver;

    @BeforeTest
    public void start() throws InterruptedException, MalformedURLException {
        DesiredCapabilities caps = new DesiredCapabilities();
        caps.setCapability("platformName", "iOS");
        caps.setCapability("platformVersion", "9.3");
        caps.setCapability("deviceName", "mydevicename");
        caps.setCapability("app", "myipafile.ipa");
        driver = new IOSDriver(new URL("http://127.0.0.0:4723/wd/hub"), caps);
        sleep(5000);
    }

    @AfterTest
    public void end() throws InterruptedException {
        sleep(5000);
        driver.quit();
    }

    @Test
    public void test() throws InterruptedException {
        System.out.println("test");
        sleep(5000);
    }
}

我尝试使用真实设备iphone 5S,我尝试使用模拟器同样的结果应用程序只需在0.5秒内打开/关闭然后它就会崩溃并且我收到此错误

[MJSONWP] Calling AppiumDriver.getStatus() with args: []

[debug] [Instruments] Attempting to launch instruments, this is try #1

[Instruments] Launching instruments

[debug] [Instruments] Attempting to run app on real device with UDID 'myudid'
[debug] [Instruments] Found Insruments-Without-Delay: /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-ios-driver/node_modules/appium-instruments/thirdparty/iwd7
[debug] [Instruments] 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 /var/folders/sw/w9bk_9_96s1bwz15mzxk3qpd7lj5f9/T/appium-instruments/instrumentscli0.trace -w myudid my.app.package -e UIASCRIPT "/Users/mobileautomation/Library/Application Support/appium/bootstrap/bootstrap-bbff984e2d53a4ae.js" -e UIARESULTSPATH /var/folders/sw/w9bk_9_96s1bwz15mzxk3qpd7lj5f9/T/appium-instruments'
[debug] [Instruments] And extra without-delay env: {}
[debug] [Instruments] And launch timeouts (in ms): {"global":90000}

[HTTP] --> GET /wd/hub/status {}

[MJSONWP] Calling AppiumDriver.getStatus() with args: []

[HTTP] <-- GET /wd/hub/status - - ms - -

[HTTP] <-- GET /wd/hub/status - - ms - -

[HTTP] --> GET /wd/hub/status {}

[MJSONWP] Calling AppiumDriver.getStatus() with args: []

[debug] [Instruments] [INST STDERR] Instruments Trace Error : Target failed to run: Permission to debug my.app.package was denied. The app must be signed with a development identity (e.g. iOS Developer).

[debug] [Instruments] Instruments exited with code 253

[Instruments] Error launching instruments: Instruments crashed on startup

我试图从我的代码中运行它,我尝试直接从appium运行它,我甚至尝试从Instruments / Automation运行它,但我继续得到相同的结果:

[INST STDERR] Instruments Trace Error : Target failed to run: Permission to debug my.app.package was denied. The app must be signed with a development identity (e.g. iOS Developer).

我在这里看到它可能与构建在&#34;发布&#34;而不是&#34;调试&#34;所以我让开发团队给我一个调试版本,但我仍然有相同的结果。

难道他们没有以正确的方式构建它吗?

我错过了什么吗?他们是否需要允许文件中的设备名称/ udid?

编辑:

我确实收到了dev的新版本,但确实存在配置文件的问题,而不是dev&amp; amp;不在调试中的构建设置

2 个答案:

答案 0 :(得分:0)

请使用应用程序的调试版本,此问题是由于未使用调试版本,您需要在iOS上进行调试构建以自动化并确保在开发人员选项中启用ui自动化

答案 1 :(得分:0)

  1. 转到以下文件夹 “/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform”

  2. 我找到了一个名为(11.2)&amp;的文件夹。我的真实设备版本是(11.2.5)

  3. 刚重命名版本名称为(11.2)的文件夹 - &gt; (11.2.5)。

  4. 我再次开始工作。