模拟器和真机都需要运行OCR的需求怎么解决?
UniUbi 发布于2017-11 浏览:1860 回复:4
0
收藏

通常开发都需要模拟器和真机无缝来回切换着开发,自从接了百度OCR以后只能选择真机来运行,因为上线前还要移除模拟器架构才能正常打包上线。
那上线了以后,后续的开发中有没有方案可以同时支持真机和模拟器的?

收藏
点赞
0
个赞
共4条回复 最后由用户已被禁言回复于2022-04
#19用户已被禁言回复于2022-04

https://developer.mozilla.org/zh-CN/search?q=%E7%8E%89%E5%92%8C%E5%A8%B1%E4%B9%90%E5%A8%81%E6%98%9F%E7%9B%B4%E8%90%A5%E5%BC%80%E6%88%B7%3AB2024.CN%E4%B8%B9%E4%B8%9C%E7%A7%BB%E5%8A%A8%EF%BC%BA%EF%BC%BD%EF%BC%BD https://b2b.baidu.com/s?q=0691888%E6%B8%AF%E9%83%BD%E8%B4%B5%E5%AE%BE%E4%BC%9A%E7%9B%B4%E8%90%A5%E5%BC%80%E6%88%B7%3AB2024%C2%B7CN%E9%95%BF%E6%98%A5%E5%AD%A6%E5%BA%9C&from=search https://developer.mozilla.org/zh-CN/search?q=%E5%AE%89%E5%BE%BD%E5%AE%89%E5%BA%86%E9%BE%99%E8%99%8E%E5%B9%B3%E5%8F%B0%E5%BC%80%E6%88%B7%E5%AE%98%E7%BD%91TL262%C2%B7C%EF%BC%AFM%E5%B9%B3%E5%87%89%E5%8D%AB%E8%A7%86%EF%BD%91 http://www.edrawsoft.cn/search/%E5%B1%B1%E4%B8%9C%E6%9B%B2%E9%98%9C%E7%9C%9F%E4%BA%BA%E6%96%97%E7%89%9B%E5%AE%98%E6%96%B9%E7%BD%91%E5%9D%80B2024.CN%E6%B3%B0%E5%B7%9E%E5%88%86%E5%85%AC%E5%8F%B8%EF%BD%9D%EF%BC%AF%EF%BD%96/ http://news.leju.com/tag/%E7%9A%87%E5%AE%B6%E5%9B%BD%E9%99%85%E5%9C%A8%E7%BA%BF%E5%85%AC%E5%8F%B8%E7%BD%91%E9%A1%B5%E7%89%88%E7%BD%91%E5%9D%80TL262%C2%B7C%EF%BC%AFM%E9%81%B5%E4%B9%89%E4%BC%81%E4%B8%9A%EF%BD%97%EF%BD%9B.html

0
#4紫剑大侠回复于2018-09

请问 AipOcrSdk-Simulator.framework这个库从哪里得来的呢?

3
#3用户已被禁言回复于2017-11

666 好帖子。应该来几个图

0
#2UniUbi回复于2017-11

解决了,如果有人需要可以按照此步骤来
1.把模拟器状态下和真机下运行出来的AipOcrSdk合并一下,命令类似这样
lipo -create AipOcrSdk-Simulator.framework/AipOcrSdk AipOcrSdk.framework/AipOcrSdk -output AipOcrSdk

然后使用这个合并以后的包

2.添加脚本到Build Phases的/bin/sh里面,内容如下,起的作用是打包时去掉模拟器架构,防止上传到APPSTORE时苹果弹错误

echo "Target architectures: $ARCHS"

APP_PATH="${TARGET_BUILD_DIR}/${WRAPPER_NAME}"

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"
echo $(lipo -info "$FRAMEWORK_EXECUTABLE_PATH")

FRAMEWORK_TMP_PATH="$FRAMEWORK_EXECUTABLE_PATH-tmp"

# remove simulator's archs if location is not simulator's directory
case "${TARGET_BUILD_DIR}" in
*"iphonesimulator")
    echo "No need to remove archs"
    ;;
*)
    if $(lipo "$FRAMEWORK_EXECUTABLE_PATH" -verify_arch "i386") ; then
    lipo -output "$FRAMEWORK_TMP_PATH" -remove "i386" "$FRAMEWORK_EXECUTABLE_PATH"
    echo "i386 architecture removed"
    rm "$FRAMEWORK_EXECUTABLE_PATH"
    mv "$FRAMEWORK_TMP_PATH" "$FRAMEWORK_EXECUTABLE_PATH"
    fi
    if $(lipo "$FRAMEWORK_EXECUTABLE_PATH" -verify_arch "x86_64") ; then
    lipo -output "$FRAMEWORK_TMP_PATH" -remove "x86_64" "$FRAMEWORK_EXECUTABLE_PATH"
    echo "x86_64 architecture removed"
    rm "$FRAMEWORK_EXECUTABLE_PATH"
    mv "$FRAMEWORK_TMP_PATH" "$FRAMEWORK_EXECUTABLE_PATH"
    fi
    ;;
esac

echo "Completed for executable $FRAMEWORK_EXECUTABLE_PATH"
echo $(lipo -info "$FRAMEWORK_EXECUTABLE_PATH")

done
0
TOP
切换版块