Search code examples
xcodexcodebuild

Create archive without Xcode


I am building an Xcode project from console over ssh (I can use only xcodebuild command), but there are no schemes in the project (user forgot to make schemes shared). xcodebuild allows to pass "archive" parameter only if building scheme (-scheme), but that is not an option for me.

So the question is: is it possible to create archive using only target?

I investigated .xcarchive directory, it contains Info.plist file (which contains information about application), dSYMs directory (containing myapp.dSYM) and Products/Applications (containing myapp.app) directory. I also noted that the file size of binary in .xcarchive's .app is 2 times smaller than in .app that is in Release directory. I guess it is because of code signage.

Can I simply copy files from Release directory (.app and .dSYM) to .xcarchive and create Info.plist there to create archive? Or are there any other steps that I must take?


Solution

  • yes, archives are only folders you can make yourself. look at ANY archive and try to replicate the folder structure. (changing the appname as required)