Xcode打包OTA包出错:ipatool failed with an exception CmdSpec NonZeroExcitException bitcode-build-tool

一、 library not found for -lXXX

  • 描述: Xcode 10 以后报错 library not found for -lstdc++.6.0.9
  • 原因: 这个错误原因是因为iOS12.0中去掉了lstdc++.6.0.9.tbd动态库
  • 解决方案: 从Xcode9中找到动态库lstdc++.6.0.9.tbd文件copy到Xcode10下就可以完美解决问题。或者用古老的办法将iOS12的DeviceSupport文件copy到Xcode9.4下也可以完美解决Xcode9运行iOS12的问题。

  • 从Xcode9中找到动态库lstdc++.6.0.9.tbd;
  • 需要将文件复制到下述四个路径下,才能保证模拟器和真机均好用
  • 真机加这个就够了
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/
    
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/
    

    二、iPhone is busy: Preparing debugger support for iPhone

  • 描述: 手机第一次链接到Xcode时出现
  • 原因: 需要识别手机
  • 解决方案:等10-15分钟。安心等待是最好的方法

    三、Expected a type

  • 描述: 写一个自定义的类,这个类继承了NSObject,其中UIView 报错 Expected a type
  • 原因: 只导入了#import <Foundation/Foundation.h>

    解决方案:导入#import <UIKit/UIKit.h>

    三、#<CmdSpec::NonZeroExcitException: Command exited with pid 22735 exit 1:

  • 描述: 打测试包时报错
  • ipatool failed with an exception: #<CmdSpec::NonZeroExcitException: Command exited with pid 22735 exit 1:
    /Applications/Xcode.app/Contents/Developer/usr/bin/bitcode-build-tool -v -t
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin -L /var/folders/n0/
    d8w9b9k10w368p0qswx479040000gn/T/ipatool20181214-19928-17ts59s/thinned-out/armv7/Payload/schoolBus.app/Frameworks/AFNetworking.framework -L /var/folders/n0/
    d8w9b9k10w368p0qswx479040000gn/T/ipatool20181214-19928-17ts59s/thinned-out/armv7/Payload/schoolBus.app/Frameworks/IQKeyboardManager.framework -L /var/folders/n0/
    d8w9b9k10w368p0qswx479040000gn/T/ipatool20181214-19928-17ts59s/thinned-out/armv7/Payload/schoolBus.app/Frameworks/MBProgressHUD.framework -L /var/folders/n0/
    d8w9b9k10w368p0qswx479040000gn/T/ipatool20181214-19928-17ts59s/thinned-out/armv7/Payload/schoolBus.app/Frameworks/MJExtension.framework -L /var/folders/n0/
    

    解决方案:如下图箭头所指的这一项不要选