ios - Cocoa Touch Framework fails to debug on simulator in embedding project -


i've got cocoa touch framework built xcode 6 targetted towards ios >= ios8. framework's target architecture settings default, meaning haven't changed anything. architectures set standard (which doesn't include x86_64, more on later). framework contains both swift , objective-c code, building using static library workaround ray wenderlich won't work.

now, if create new project , add framework project it, project builds both device , simulator, fine.

however, if take .framework file , add different project you'd add other framework, project won't build simulator. well, build, crashes because can't find relevant classes. works fine on device , archiving works expected well.

the framework project gives me warning; "apple mach-o linker warning - directory not found option ....(debug-ophoneos)".

any highly appreciated!

i have found solution issue. turns out, xcode no longer creates fat binaries out of box. no idea apple's reasoning behind might be, me seems guys responsible xcode make fun of developers using product...

anyways, can find definitive guide how create fat binary simulator , ios devices (yes, have lipo different architectures in order framework works on newer , older devices): https://kodmunki.wordpress.com/2015/03/04/cocoa-touch-frameworks-for-ios8-remix/

in short;

  • create cocoa touch framework
  • set architectures arm64, armv7, , armv7s
  • set "build active architecture" "no"
  • set "valid architectures" arm64, armv1, , armv7s
  • add following script framework's build scheme archive post-action;

    set -e

    device_bin="${objroot}/uninstalledproducts/${target_name}.framework" simulator_bin="${symroot}/../../../../products/debug- iphonesimulator/${target_name}.framework"

    archive_path="${srcroot}/_archive" rm -rf "${archive_path}" mkdir "${archive_path}"

    if [ "${configuration}" = "release" ]; then

    if [ -d "${device_bin}" ]; device_path="${archive_path}/release" mkdir "${device_path}" cp -r "${device_bin}" "${device_path}" fi if [ -d "${simulator_bin}" ]; simulator_path="${archive_path}/debug" mkdir "${simulator_path}" cp -r "${device_bin}" "${simulator_path}" lipo -create "${device_bin}/${target_name}" "${simulator_bin}/${target_name}" -output "${simulator_path}/${target_name}.framework/${target_name}"

    fi

    fi

    exit 0;

this create _archive directory in project's directory can find frameworks both debug , release.

important: of today (may 22nd 2015) you'll have build project simulator first, , archive device. otherwise won't universal binary!

this post has been created in order avoid dead link errors, updates regarding packaging process, please try steps posted on kodmunki website i've linked above first steps in post might have been outdated already!


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

c# - Retrieve google contact -

javascript - How to insert selected radio button value into table cell -