Search code examples
ioscalabashcalabash-ios

calabash-ios not working with iOS 7.1 Simulators


I'm trying to do some automated UI testing using Calabash, everything works great when I'm running on iOS 8 simulators, however, the minute I switch to an iOS 7 simulator, it doesn't seem to be able to fully start up the app.

The app will open, finish the splash screen, then shortly after it will crash and calabash will retry again. This continues indefinitely until I manually quit it.

The only thing changing between running is my device target, currently I'm using the following for device target:

DEVICE_TARGET="iPhone 5 (7.1 Simulator)"

And when I run on an 8.4 device, it looks like the following:

DEVICE_TARGET="iPhone 5 (8.4 Simulator)"

Any ideas why this isn't working? Is 7.1 not supported on calabash-ios?

More info:

  • Calabash is version 0.14.3
  • It works flawlessly on other simulators, iPhone 6, iPhone 6 Plus, iPhone 5s, as long as its running iOS 8 or greater
  • I can't do the particular testing I want to do on iOS 8 for the moment, we have a UI bug only present in iOS 8, so this specific test needs to be run in iOS 7 for the time being until the UI issue is fixed
  • I know the feature I'm trying to run works, and that my calabash setup is correct, this is one of the last test scripts I need to run and write, and all the other have worked flawlessly, so I suspect it may be an issue with iOS 7 or the way my iOS 7 simulators are setup compared to the iOS 8 ones.

I'd appreciate any help you can provide!


Solution

  • UPDATE This SO answer has some suggestions about how to fix this problem.

    Officially, Calabash iOS supports iOS >= 7.1 simulators on Yosemite and iOS >= 7.0.3 on Mavericks.

    Do you have the same problem on physical devices?

    If you have:

    1. changed the location on the file system or renamed Xcode.app directory,
    2. installed a new Xcode version, or
    3. installed a new iOS Simulator

    you must restart your Mac to get the CoreSimulator environment into a good shape.

    With that said, I am working on integration tests for run-loop and I am seeing unexplained errors launching iOS 7.1 Simulators in Xcode 6.4 on Yosemite. It looks like UIAutomation is not available on iOS 7.1 Simulators on Yosemite.

    $ DEBUG=1 be run-loop instruments \
       launch --app ./CalSmoke-cal.app \
       --device "iPhone 5s (7.1 Simulator)"
    Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
    0   libsystem_kernel.dylib          0x00000001032a6286 __pthread_kill + 10
    1   libsystem_sim_c.dylib           0x0000000102fd4e59 abort + 101
    2   com.apple.ScreenReaderCore      0x00000001047d3114 SCRCUncaughtExceptionHandler + 97
    3   com.apple.CoreFoundation        0x0000000100691bf5 __handleUncaughtException + 629
    4   libobjc.A.dylib                 0x00000001025bebf5 _objc_terminate() + 94
    5   libc++abi.dylib                 0x0000000102e4de91 std::__terminate(void (*)()) + 8
    6   libc++abi.dylib                 0x0000000102e4d91d __cxa_throw + 124
    7   libobjc.A.dylib                 0x00000001025bea9d objc_exception_throw + 298
    8   com.apple.CoreFoundation        0x000000010060d2ad +[NSException raise:format:] + 205
    9   com.apple.UIAutomation          0x0000000100de96f7 +[UIAXElement initializeAccessibility] + 540
    10  com.apple.UIAutomation          0x0000000100dec791 +[UIAXElement uiaxSystemWideElement] + 36
    11  com.apple.UIAutomation          0x0000000100dff833 -[UIATarget init] + 300
    12  com.apple.UIAutomation          0x0000000100dff6f9 +[UIATarget localTarget] + 53
    13  ScriptAgent                     0x0000000100008ea8 0x100000000 + 36520
    14  ScriptAgent                     0x0000000100004b17 0x100000000 + 19223
    15  ScriptAgent                     0x0000000100006e22 0x100000000 + 28194
    16  libdyld.dylib                   0x00000001031795c9 start + 1
    

    I have tried a couple of patches on run-loop, but nothing is working.

    There is also this from the Console.app

    com.apple.CoreSimulator.CoreSimulatorService[81434]: Failed to open 
    /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 7.1.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/host/liblaunch_sim.dylib: 
    dlopen(/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 7.1.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/host/liblaunch_sim.dylib, 1): no suitable image found.  
    Did find:
    /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 7.1.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/host/liblaunch_sim.dylib: 
    mmap() error 1 at address=0x11837B000, size=0x00002000 segment=__TEXT in Segment::map() 
    mapping /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 7.1.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/host/liblaunch_sim.dylib