calabashcalabash-ios

start_test_server_in_background throws NoMethodError: undefined method 'path' for nil:NilClass


I have two machines that work just fine, but the most resent machine that I am configuring is not able to start the test server in the console.

Screenshot:
Console output

I have been banging my head against it all day and I cannot figure out what is going wrong. Is there anything obvious that I am missing that would cause this?

Update This issue, at least for me, was caused by having a relative path in my APP_BUNDLE_PATH. I had APP_BUNDLE_PATH="~/Documents/workspace/...". As soon as I made that the full explicit path I no longer got the errors trying to start up a test server.


Solution

  • We are tracking this bug here:

    nil path when preparing simulator in compatible arches check when APP was not set correctly

    Until it is fixed, set the APP environment variable.

    $ APP=./path/to/my.app calabash-ios console
    

    UPDATE

    The problem has been fixed in the develop branch and will be available in run_loop 2.3.1.

    The cause of the problem is that some combination of APP, APP_BUNDLE_PATH, and BUNDLE_ID is incorrect for a simulator target.

    Either:

    1. APP or APP_BUNDLE_PATH does not point to directory that exists. If you are setting one of these variables, make sure the .app bundle exists.
    2. You are targeting a simulator one of the three variables above is being set to a bundle identifier, e.g. APP=com.example.MyApp. It is invalid to use a bundle identifier when targeting a simulator.

    If you are not explicitly setting any variables when launch the console, see if they are defined in the environment.

    $ echo $APP
    $ echo $APP_BUNDLE_PATH
    $ echo $BUNDLE_ID
    

    If they are not defined and you are still getting this error, please open an issue with debug logging.

    $ DEBUG=1 calabash-ios console
    > start_test_server_in_background
    
    $ calabash-ios console
    > verbose
    > start_test_server_in_background