No product after cocoa static library project build success

I searched for so many problems, but I am not. on Xcode 4.3.2 (4.3.1)

I added several files to the new cocoa touch static library project and use iPhone Simulator to create it, and then I get build success , but there is no .a file in the product group (the .a file is red in the file list to the left of Xcode)

When I change “iPhone Simulator” to IOS Device , I also get build success , but now I see that the .a file is not red, and I can find the product folder ^

After I use lipo -info to check the .a file, it shows that it only supports the arm7 architecture, thus confirming my first action (there is no product built into Simulator ) ^ therefore the .a file cannot be used in my other project (I know that it can only be used in a simulator, supporting the i386 architecture)

+4
source share
1 answer

Use the command line. Here is a simple script that I built some time ago, it will even lipo your binary files together for you!

#!/bin/bash #build the device echo building for ARM architecture xcodebuild -sdk iphoneos4.3 "ARCHS=armv6 armv7" build > /dev/null #build the simulator echo building for the i386 architecture xcodebuild -sdk iphonesimulator4.3 "ARCHS=i386 x86_64" "VALID_ARCHS=i386 x86_64" build > /dev/null #make the folder mkdir "Fat Binary" #lipo suck it together echo lipo binaries together lipo -output Fat\ Binary/libMyLib.a -create build/Release-iphoneos/liblibMyLib.a build/Release-iphonesimulator/libMyLib.a echo lipo binary saved at $./Fat Binary/libMyLib.a echo coping headers cp -R build/Release-iphoneos/usr "Fat Binary" echo [COMPLETE] 

Just replace the entries of libMyLib.a with your library name.

0
source

Source: https://habr.com/ru/post/1414896/


All Articles