Can't connect to Mobile Safari in iOS Simulator using Node Can't connect to Mobile Safari in iOS Simulator using Node ios ios

Can't connect to Mobile Safari in iOS Simulator using Node


Issue is line 36:

data.__argument.WIRSocketDataKey = JSON.stringify(data.__argument.WIRSocketDataKey);

bplistCreator.js treats WIRSocketDataKey as a string when it's actually data in bplist terms.

Line 36 should be:

data.__argument.WIRSocketDataKey = new Buffer(JSON.stringify(data.__argument.WIRSocketDataKey));

For this to work the version of bplistCreator.js from GH is required as the version with data support doesn't appear to be available via npm yet https://github.com/nearinfinity/node-bplist-creator


Have kept history below just for reference:

Done a bit more digging and watching the system.log during execution...

tail -f /var/log/system.log

And I see the following when the browser crashes

-[__NSCFString bytes]: unrecognized selector sent to instance 0xa947af0*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString bytes]: unrecognized selector sent to instance 0xa947af0'*** First throw call stack:(0x48b012 0x1578e7e 0x5164bd 0x47abbc 0x47a94e 0x413390 0x43b763 0xb55415 0x44bf0f5 0x45080d8 0x45085f1 0x3557548 0x40ef3f 0x40e96f 0x431734 0x430f44 0x430e1b 0x3556c50 0x9026e557 0x90258cee)com.apple.launchd.peruser.501[237] (UIKitApplication:com.apple.mobilesafari[0x10ee][59604]):     Job appears to have crashed: Abort trap: 6backboardd[54902]: Application 'UIKitApplication:com.apple.mobilesafari[0x10ee]' exited     abnormally with signal 6: Abort trap: 6ReportCrash[59611]: Saved crash report for MobileSafari[59604] version 1659.13 to /Users/xx/Library/Logs/DiagnosticReports/MobileSafari_2013-01-29-212042_Andy-Daviess-MacBook-Pro.crash

(I've removed times and dates from above)

EDIT:

I think the issue is that WIRSocketDataKey is being sent as a string when it should be data

Doesn't look like node-bplist-creator supports data type at the moment so that's the first thing that we need to fixup.

EDIT 2:

GH version of node-bplist-creater does support data type, but doesn't appear to be packaged (???)

EDIT 3:

Got it working will send you a pull request tomorrow!


matomo