Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

weinre with iPhone simulator

I am experimenting the PhoneGap development for IPhone. The environment is XCode 4.1, PhoneGap 1.0. I am using the Weinre remote debugger according to the tutorial provided by PhoneGap, when I run the app in IPhone Simulator, I got this error shown in XCode output:

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

The URL is pointing to the Weinre server and it works in browser. I can't find anything about the "whitelist rejection" error in google. Any idea what does this mean?

Thanks!

like image 921
ycseattle Avatar asked Aug 31 '11 16:08

ycseattle


2 Answers

whitelist support was recently added to phonegap. see here and here.

to fix this, you just need to add the needed domains in your PhoneGap.plist to your ExternalHosts-Array.

In your case, it would be localhostand would look like this:

just code, because can't post an image:

<key>ExternalHosts</key>
<array>
    <string>localhost</string>
    <string>debug.phonegap.com</string>
</array>
like image 157
Flori Avatar answered Nov 10 '22 08:11

Flori


Now that Apache Foundation has taken over the name has changed from PhoneGap.plist to Cordova.plist, but it's still ExternalHosts, this helped me get Weinre running which makes a huge difference when debugging directly on an iDevice.

like image 2
Thomas Bindzus Avatar answered Nov 10 '22 09:11

Thomas Bindzus