【发布时间】:2016-10-25 09:51:16
【问题描述】:
我正在尝试使用 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).
我在这里看到,这可能与构建处于“发布”而不是“调试”这一事实有关,所以我要求开发团队给我一个调试构建,但我仍然得到相同的结果.
可能是他们没有以正确的方式构建它吗?
我错过了什么吗?他们是否需要允许文件中的设备名称/ udid 或其他内容?
编辑:
我确实收到了一个新的开发版本,它确实是一个不在开发中的配置文件和不在调试中的构建设置的问题
【问题讨论】:
-
> 应用必须使用开发身份签名
标签: ios appium instruments