Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

should be dynamically loading iPhoneSimulatorRemoteClient framework #65

Closed
thehesiod opened this issue Oct 29, 2013 · 5 comments
Closed

Comments

@thehesiod
Copy link

or else the app is tied to the version of xcode you compiled it with

you should be getting this from DEVELOPER_DIR environment variable or xcode-select -print-path

@thehesiod
Copy link
Author

btw, work-around is setting:

export DYLD_FRAMEWORK_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks:/Applications/Xcode.app/Contents/OtherFramework

but it would be nice it it behaved nicely with the existing xcode-select/DEVELOPER_DIR mechanism

@shazron
Copy link

shazron commented Oct 30, 2013

Awesome - thanks, I'll try to get to this soon, either that if you want to send a pull request that will be great as well

@thehesiod
Copy link
Author

Unfortunately I'm not exactly sure how to dynamically load objective C framework APIs yet. Would take me at least a couple days research (If I get some time off I'll try, also I'm a github newb, more of a perforce person) btw, here's what I'm currently using in my bash build scripts after manually setting DEVELOPER_DIR based on the xcode selected:

export DYLD_FRAMEWORK_PATH=${DEVELOPER_DIR}/Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks:$(dirname "${DEVELOPER_DIR}")/OtherFrameworks

Also, if you want an even BETTER solution you can enumerate the versions of xcode installed and list ALL the available simulators/sdks for ALL xcode apps installed and then enumerate through all the available frameworks :)
(see below python script) Actually, what I would do is re-write ios-sim in python using ctypes, it would be cooler and be even better for my workflows, hehe :)

def findXCodeVersions(verbose=False):
    plist = plistlib.readPlistFromString(runCMD("system_profiler", ["-xml", "SPDeveloperToolsDataType"], verbose=verbose))[0]
    result = { }
    for item in plist["_items"]:
        version = item["spdevtools_version"].split(" ")[0]
        app_path = dev_path = item["spdevtools_path"]
        if not dev_path.endswith("Developer"): dev_path += "/Contents/Developer"

        sdks = item["spdevtools_sdks"]
        iphonesdks = osxsdks = []

        if "spiphoneos_sdks" in sdks:
            iphonesdks = list(sdks["spiphoneos_sdks"].keys())
        elif "spios_sdks" in sdks:
            iphonesdks = list(sdks["spios_sdks"].keys())

        if "spmacosx_sdks" in sdks:
            osxsdks = list(sdks["spmacosx_sdks"].keys())
        elif "sposx_sdks" in sdks:
            osxsdks = list(sdks["sposx_sdks"].keys())

        result[version] = { "apppath" : app_path, "devpath" : dev_path, "iossdks" : iphonesdks, "osxsdks" : osxsdks }

    return result

Thanks for the quick response btw!

@fpotter
Copy link

fpotter commented Dec 11, 2013

FWIW, we had this same issue come up in xctool.

Here's how we solved it --
https://github.com/facebook/xctool/blob/master/xctool/xctool/main.m#L25

@shazron
Copy link

shazron commented Mar 14, 2014

With Xcode 5.1, iPhoneSimulatorRemoteClient has been removed, so ios-sim is using DVTiPhoneSimulatorRemoteClient now with v1.9.0

@shazron shazron closed this as completed Mar 14, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants