我们用iPhone模拟器

ycs*_*tle 9 ios cordova weinre

我正在试验iPhone的PhoneGap开发.环境是XCode 4.1,PhoneGap 1.0.我根据PhoneGap提供的教程使用Weinre远程调试器,当我在iPhone模拟器中运行应用程序时,我在XCode输出中显示此错误:

2011-08-31 09:31:15.275 Contacts[898:11803] ERROR whitelist rejection: url='http://localhost:8080/target/target-script-min.js#anonymous'
Run Code Online (Sandbox Code Playgroud)

URL指向Weinre服务器,它在浏览器中工作.我在谷歌找不到任何关于"白名单拒绝"的错误.知道这是什么意思吗?

谢谢!

Flo*_*ori 26

白名单支持最近被添加到phonegap.看到这里这里.

要解决此问题,您只需将所需的域添加PhoneGap.plist到您的ExternalHosts-Array中.

在你的情况下,它会是localhost,看起来像这样:

只是代码,因为无法发布图片:

<key>ExternalHosts</key>
<array>
    <string>localhost</string>
    <string>debug.phonegap.com</string>
</array>
Run Code Online (Sandbox Code Playgroud)