我正在使用 Xcode 6.4 将第三方框架集成到我的 AppStore 应用程序中。第三方的框架是一个通用二进制文件,当我执行文件命令时,它具有以下内容:
DeviceTester (for architecture i386): Mach-O dynamically linked shared library i386
DeviceTester (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64
DeviceTester (for architecture armv7): Mach-O dynamically linked shared library arm
DeviceTester (for architecture arm64): Mach-O 64-bit dynamically linked shared library
我已尝试将此框架添加为嵌入式二进制文件。这很好用,但是当我将“ipa”上传到 AppStore 时,它会提示 ipa 具有不受支持的架构,即模拟器部分。当我检查 ipa 文件时,我确实看到了一个“框架”文件夹,其中包含通用框架。但是对于我包括的任何其他框架,我都没有看到这一点。 Crashlytics/Fabric 等。所以这里有一些不正确的地方。
我也尝试将它添加为框架,然后确保它处于复制阶段,但运行它会在设备上出现以下错误:
dyld: Library not loaded: @rpath/DeviceTester.framework/DeviceTester
Referenced from: /var/mobil....
任何指针都很高兴,我今天花了一整天的时间试图弄清楚发生了什么没有运气.. 干杯。
来自 Xcode 6.1.1 & 6.2: iOS frameworks containing simulator slices can't be submitted to the App Store .您需要从 fat 框架中删除模拟器切片才能提交到 AppStore。
这是一个执行魔法的脚本。在构建步骤中添加一个运行脚本步骤,将其放在嵌入框架的步骤之后,将其设置为使用 /bin/sh
并输入以下脚本:
APP_PATH="${TARGET_BUILD_DIR}/${WRAPPER_NAME}"
# This script loops through the frameworks embedded in the application and
# removes unused architectures.
find "$APP_PATH" -name '*.framework' -type d | while read -r FRAMEWORK
do
FRAMEWORK_EXECUTABLE_NAME=$(defaults read "$FRAMEWORK/Info.plist" CFBundleExecutable)
FRAMEWORK_EXECUTABLE_PATH="$FRAMEWORK/$FRAMEWORK_EXECUTABLE_NAME"
echo "Executable is $FRAMEWORK_EXECUTABLE_PATH"
EXTRACTED_ARCHS=()
for ARCH in $ARCHS
do
echo "Extracting $ARCH from $FRAMEWORK_EXECUTABLE_NAME"
lipo -extract "$ARCH" "$FRAMEWORK_EXECUTABLE_PATH" -o "$FRAMEWORK_EXECUTABLE_PATH-$ARCH"
EXTRACTED_ARCHS+=("$FRAMEWORK_EXECUTABLE_PATH-$ARCH")
done
echo "Merging extracted architectures: ${ARCHS}"
lipo -o "$FRAMEWORK_EXECUTABLE_PATH-merged" -create "${EXTRACTED_ARCHS[@]}"
rm "${EXTRACTED_ARCHS[@]}"
echo "Replacing original executable with thinned version"
rm "$FRAMEWORK_EXECUTABLE_PATH"
mv "$FRAMEWORK_EXECUTABLE_PATH-merged" "$FRAMEWORK_EXECUTABLE_PATH"
done
这个答案可能会解释你在问什么。 https://stackoverflow.com/a/31270427/4160199
关于ios - 在 AppStore 应用程序中使用第三方框架会引入 iPhoneSimulator 位,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34347810/
欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://jike.in/) | Powered by Discuz! X3.4 |