Skip to content
This repository has been archived by the owner on Feb 2, 2021. It is now read-only.

force otest-query for application tests to use the i386 flavor of the TEST_HOST #200

Closed
wants to merge 1 commit into from

Commits on Oct 11, 2013

  1. force otest-query for application tests to use the i386 flavor of the…

    … TEST_HOST
    
    This fixes the problem where xctool would fail to query the list of
    tests cases in the best bundle.  i.e. --
    
    ```
    failed: Failed to query the list of test cases in the test bundle: dyld:
    could not load inserted library:
    /usr/local/Cellar/xctool/0.1.13/libexec/lib/otest-query-ios-dylib.dylib
    ```
    
    The problem was that, if the .app was built using ONLY_ACTIVE_ARCH=NO,
    the .app would actually be Universal with x86_64 and i386 versions.
    When we would launch the app with otest-query-ios-dylib injected, it
    would crash since the x86_64 flavor of the .app was being launched, but
    the dylib is i386 only.
    
    The right thing to do here is just force the .app launch to be
    i386-only.  Even though you CAN trick Xcode/xcodebuild/xctool into
    building Universal versions of simulator apps, Xcode.app will only ever
    run the i386 versions of your .apps and test bundles.  It does not care
    if your binary is universal - xctool should follow suit.
    
    Test Plan:
    Created a test project as per @sandervandenbrink's comment --
    @#170 (comment)
    
    Ran the following and observed things crashed --
    
    ```
    xctool -project foo.xcodeproj -scheme foo -sdk iphonesimulator7.0 ONLY_ACTIVE_ARCH=NO clean test
    ```
    
    Applied the fix, and ran the same command and observed things now
    worked.
    fpotter committed Oct 11, 2013
    Configuration menu
    Copy the full SHA
    7266177 View commit details
    Browse the repository at this point in the history