iOS simulator on mac is running i386 architecture, not armv7?

前端 未结 4 1522
清歌不尽
清歌不尽 2021-02-19 03:00

I\'ve got some static libraries I\'ve built for use on armv7 architectures. When I try to use them in a iOS project which I testrun on the iphone 5.0 simulator, I get errors tel

4条回答
  •  攒了一身酷
    2021-02-19 03:32

    You can actually compile the app through Xcode command line tool using i386 architecture (there is also a way to run it in Xcode UI by modifying the build settings).

    xcodebuild -sdk iphonesimulator6.1 -arch i386 VALID_ARCHS="i386 armv7 armv7s" clean install
    

    Run this command in the directory that you have the projectName.xcodeproj file.

    Here's a break down of the script:

    -sdk iphonesimulator6.1 // Build the app on iPhone simulator 6.1
    -arch i386 // Build your app using i386 architecture
    VALID_ARCHS="i386 armv7 armv7s" // Specify these architectures are valid
    clean install // Clean all the builds then re-build and install
    

提交回复
热议问题