ios - 错误 : Target failed to run: Permission to debug com. apple.Preferences 被拒绝

标签 ios automation automated-tests appium

在 Appium 上运行第一个测试,我在日志中收到错误。

Appium version 1.4.13
xcode version 7.2

Appium 的 iOS 设置: http://screenpresso.com/=nD2Cf 。 这是我的java代码:

import io.appium.java_client.AppiumDriver;
import io.appium.java_client.MobileElement;
import io.appium.java_client.ios.IOSDriver;
import io.appium.java_client.remote.MobileCapabilityType;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.concurrent.TimeUnit;

/**
 * Created by betbull on 1/29/16.
 */
public class Runing {
    public static AppiumDriver wd;

    public static void main(String[] args) throws MalformedURLException {
        DesiredCapabilities capabilities = new DesiredCapabilities();
        capabilities.setCapability("appium-version", "1.4.13");
        capabilities.setCapability("platformName", "IOS");
        capabilities.setCapability("platformVersion", "9.2");
        capabilities.setCapability("deviceName", "iPhone6");
        capabilities.setCapability("app", "settings");
        wd = new IOSDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
        wd.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);
    }

}

使用appium记录:

info: [debug] [INST STDERR] 2016-02-01 21:26:16.580 instruments[63237:1021849] WebKit Threading Violation - initial use of WebKit from a secondary thread.

info: [debug] [INST STDERR] 2016-02-01 21:26:21.158 instruments[63237:1021937] Attempting to change event horizon while disengage

info: [debug] [INST STDERR] 2016-02-01 21:26:21.159 instruments[63237:1021938] Attempting to change event horizon while disengage

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

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 iOS Simulator

最佳答案

您是否使用开发证书签署了您的应用程序并将“构建配置”设置为“调试”(默认情况下通常设置为“发布”)? 应用程序必须使用开发身份进行签名(例如 iOS Developer)。 告诉我您没有。

this post 中所述和 this post ,只需在“配置文件 [应用程序名称]”下为您的目标设置您的方案即可。

关于ios - 错误 : Target failed to run: Permission to debug com. apple.Preferences 被拒绝,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35138822/

相关文章:

ios - DispatchQueue.global(qos : . userInteractive).async 是否与 DispatchQueue.main.async 相同

ios - 优胜美地崩溃下的 Xcode 6

iOS连续淡出淡入动画

ios - Twilio iOS SDK 在去电时失败并显示 "400 Bad request"

macos - 苹果操作系统 X : interacting with an application programmatically

java - TestNG 依赖于不同类的方法

testing - Telerik 控件和 UI 自动化?

java - 如何使用 AutoIt 设置 Internet Explorer 选项?

testing - 自动测试应用程序可执行文件(基于 Windows 的应用程序)

ios - dyld:无法加载插入的库