calabash / calabash-ios

Calabash for iOS
Other
1.81k stars 369 forks source link

LPServer Port change crashes application #1364

Closed tardoandre closed 6 years ago

tardoandre commented 6 years ago

Hi people,

I need to change the default Calabash server port. After setting any value using the key CalabashServerPort on my application Info.plist, it crashes the app with the following logs:

CalabashServer | Will start LPServer with identifier: c8759827c0fffb8a6c7960160a31889d0a83dad9 2018-01-29 16:16:44.315219-0200 mobile200-cal[4747:5152397] -[NSTaggedPointerString unsignedShortValue]: unrecognized selector sent to instance 0xa000035363237335 2018-01-29 16:16:44.328483-0200 mobile200-cal[4747:5152397] Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSTaggedPointerString unsignedShortValue]: unrecognized selector sent to instance 0xa000035363237335' First throw call stack: ( 0 CoreFoundation 0x0000000113b1f12b exceptionPreprocess + 171 1 libobjc.A.dylib 0x0000000112d6ef41 objc_exception_throw + 48 2 CoreFoundation 0x0000000113ba0024 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132 3 CoreFoundation 0x0000000113aa1f78 __forwarding + 1432 4 CoreFoundation 0x0000000113aa1958 _CF_forwarding_prep_0 + 120 5 mobile200-cal 0x000000010d7e1330 -[LPInfoPlist serverPort] + 160 6 mobile200-cal 0x000000010d7dfb42 -[CalabashServer init] + 3106 7 mobile200-cal 0x000000010d7dec45 +[CalabashServer start] + 69 8 mobile200-cal 0x000000010d82b4c7 _Z21_calabashserverinitv + 119 9 mobile200-cal 0x000000010d82b5e9 cxx_global_var_init + 9 10 mobile200-cal 0x000000010d82b609 _GLOBAL__sub_I_LPI.mm + 9 11 ??? 0x000000010ddffc16 0x0 + 4527750166 12 ??? 0x000000010ddffe46 0x0 + 4527750726 13 ??? 0x000000010ddfb6da 0x0 + 4527732442 14 ??? 0x000000010ddfa898 0x0 + 4527728792 15 ??? 0x000000010ddfa92c 0x0 + 4527728940 16 ??? 0x000000010ddef17b 0x0 + 4527681915 17 ??? 0x000000010ddf2c98 0x0 + 4527697048 18 ??? 0x000000010ddee3d4 0x0 + 4527678420 19 ??? 0x00000001189b1ded 0x0 + 4707786221 20 ??? 0x00000001189af7a3 0x0 + 4707776419 21 ??? 0x00000001189ab3d4 0x0 + 4707759060 22 ??? 0x00000001189ab1d2 0x0 + 4707758546 23 ??? 0x0000000000000001 0x0 + 1 ) libc++abi.dylib: terminating with uncaught exception of type NSException

Any idea? How can I properly change the default port (32765)?

JoeSSS commented 6 years ago

I don’t think that it is possible. You may be able to change the server port, but not the DeviceAgent one

tardoandre commented 6 years ago

As previously mentioned by @jmoody at this issue, its possible to change the LPServer port by setting the CalabashServerPort key in the app's Info.plist, however the DeviceAgent port cannot be changed as you said.

But setting any value into CalabashServerPort invokes a crash on the application framework.

jmoody commented 6 years ago

I think the type of your key is incorrect. It is probably String and it needs to be Number

tardoandre commented 6 years ago

@jmoody how exactly would I declare a Number inside Info.plist? The default pattern is to provide a key and a string only.

jmoody commented 6 years ago

Through the Xcode UI, choose Number.

If you want to edit the .plist directly:

    <key>LPServerPort</key>
        <integer>33340</integer>

default pattern

What pattern?

tardoandre commented 6 years ago

@jmoody funny behavior, when you edit the source code for Number directly on Xcode p.list it fails with the following error: couldn't parse contents of _projectpath.The data couldn’t be read because it isn’t in the correct format.

Through the Xcode UI, it works. Maybe the IDE inserts an invisible character or something around it. Thanks for the help, by the way, it worked.