Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/102.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 错误:目标无法运行:调试com.apple.Preferences的权限被拒绝_Ios_Automation_Automated Tests_Appium - Fatal编程技术网

Ios 错误:目标无法运行:调试com.apple.Preferences的权限被拒绝

Ios 错误:目标无法运行:调试com.apple.Preferences的权限被拒绝,ios,automation,automated-tests,appium,Ios,Automation,Automated Tests,Appium,在Appium上运行第一个测试,我在日志中发现一个错误 Appium version 1.4.13 xcode version 7.2 使用appium的iOS设置: . 以下是我的java代码: import io.appium.java\u client.AppiumDriver; 导入io.appium.java_client.MobileElement; 导入io.appium.java_client.ios.IOSDriver; 导入io.appium.java_client.rem

在Appium上运行第一个测试,我在日志中发现一个错误

Appium version 1.4.13
xcode version 7.2
使用appium的iOS设置: . 以下是我的java代码:

import io.appium.java\u client.AppiumDriver;
导入io.appium.java_client.MobileElement;
导入io.appium.java_client.ios.IOSDriver;
导入io.appium.java_client.remote.MobileCapabilityType;
导入org.openqa.selenium.WebDriver;
导入org.openqa.selenium.remote.DesiredCapabilities;
导入org.openqa.selenium.remote.RemoteWebDriver;
导入java.net.MalformedURLException;
导入java.net.URL;
导入java.util.concurrent.TimeUnit;
/**
*betbull于2016年1月29日创建。
*/
公共类运行{
公共静态应用程序;
publicstaticvoidmain(字符串[]args)引发畸形的DurLexException{
DesiredCapabilities=新的DesiredCapabilities();
能力。设置能力(“appium版本”、“1.4.13”);
能力。设置能力(“平台名”、“IOS”);
能力。设置能力(“平台版”、“9.2”);
能力。设置能力(“deviceName”、“iPhone6”);
能力。设置能力(“应用程序”、“设置”);
wd=新的IOSDriver(新的URL(“http://127.0.0.1:4723/wd/hub(能力),;
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

您是否使用开发证书对应用程序进行了签名,并将生成配置设置为
Debug
(默认情况下通常设置为
Release
)<代码>应用程序必须使用开发身份(例如iOS开发者)签名。告诉我您没有


如和中所述,只需在“Profile[App Name]”下为目标设置方案即可。

如果将生成配置更改为debug不起作用,请关闭所有应用程序并尝试重新启动系统。这为我解决了问题。

似乎XCode中的仪器在您的机器上没有正确的访问权限。尝试单独启动一次。谢谢,这解决了我与其他解决方案组合的问题。我已停止所有正在运行的应用程序并重新启动计算机。