What does the install ,installsrc and testdo while using the Xcode Project runner.
When I build using clean build archive I am getting only the .app and not .ipa .Are there any command line parameters that is to be added to the step.Please help me out.
The archive build action generates a .xcarchive file. To create an .ipa file you have to add a subsequent command line build step in teamcity with the following command:
xcodebuild -exportArchive -archivePath projectname.xcarchive -exportPath projectname -exportFormat ipa
Related
I have created a xcworkspace to add my iOS.xcproj and local swift package. The workspace builds and runs great from Xcode. What would be the xcodebuild command to do in my CI?
I have been trying using the following:
xcodebuild -workspace [name].xcworkspace -scheme [scheme_name] -configuration [config] -xcconfig [path_xcconfig]
I get this in the output console:
...note: Building targets in dependency order
error: Multiple commands produce <RegisterExecutionPolicyException...
sample:
note: Target 'Firebase_FirebaseInAppMessaging_iOS' (project 'Firebase'): Touch /Users...
I'm trying to build an Xcode project through the terminal. My project uses a submodule called SwiftRichString which I'm importing in one of my files.
On my terminal, I tried:
xcodebuild -project MyProject.xcodeproj
But this says that it cannot find the module called SwiftRichString, as expected.
So then I tried,
xcodebuild -scheme SwiftRichString
This worked and said "Build Succeeded", but then if I try to do
xcodebuild -project MyProject.xcodeproj
it fails just like before.
If I go to Xcode and go to Product>Scheme>SwiftRichString and build it, it succeeds building. Then if I build my project within Xcode, it works, but it doesn't build in terminal.
Create archive:
xcodebuild -archivePath MyApp -project /Users/dima/MyApp/MyApp.xcodeproj -scheme MyApp archive
Ok, let's build .app:
xcodebuild -exportArchive -exportFormat APP -archivePath MyApp.xcarchive -exportPath MyApp -exportSigningIdentity "Developer ID Application: MY NAME"
I got MyApp.app
But when I check app I got this message:
a sealed resource is missing or invalid
I got several subproject-frameworks dependencies, use Swift. And if I will make export archive by hand, all works and signed ok.
XCode 7 beta 3.
Update
Seems this problem related to fact that My project has other projects inside (frameworks). Test app without dependencies works fine.
Tries to update project to workspace and change script to use workspace seems not solve the problem
I have an iOS Xcode project that has several targets. The number of targets in the project will continue to grow as the project progresses and expands. When I create a new version, it is a pain to have to go through each target and manually create the Archive. I looked into how to archive multiple targets using the command line, but none of the answers spoke to what I was trying to accomplish. Any help and guidance is appreciated.
I believe that the following partial command is part of the solution:
xcodebuild archive
archive: Archive a scheme from the build root (SYMROOT). This requires specifying a workspace and scheme.
I suppose you want to build it for CI server Manually
If you want to read all the schemes in a xcode project
xcodebuild -list | awk 'p && NF {print \$0";";} /Schemes:/ {p=1}' > schemeList.txt
This will put all your schemes in a text file. Then you have to read the text file manually to retrieve each scheme.
You can use the below command line to produce the archive
xcodebuild -scheme ${schemeName} -sdk iphoneos$sdkVersion -configuration Release clean archive -archivePath ${archivePath}.xcarchive
And then the below xcode command to produce the ipa.
xcodebuild -exportArchive -archivePath ${archivePath}.xcarchive -exportOptionsPlist exportOptions.plist -exportPath ${exportPath}
I use following command to build project using xcodebuild from the directory where .xcodeproj is.
admin$ xcodebuild install DSTROOT=. INSTALL_PATH=/bin
Could someone please tell me how to specify full path of .xcodeproj in xcodebuild command and run it from anywhere?
[EDIT]
...so you cannot specify absolute path of the project with xcodebuild command but you can specify where do you want your .app file placed like following. You need to run this command from the root project directory and you will be able to compile other sub projects without CD to their directories but you need to specify "scheme" that you are building.
admin$ xcodebuild install DSTROOT=/Users/admin/myProjectRoot INSTALL_PATH=/bin -scheme MySubProject1 -configuration Release -sdk iphonesimulator clean build
According to the manpage for xcodebuild, you must launch "xcodebuild" from within the directory where your project is. I.E. the specific line that clarifies that is:
To build an Xcode project, run xcodebuild from the directory
containing your project (i.e. the directory containing the
projectname.xcodeproj package).
And if there are multiple projects within that directory, that's when you can use the "-project projectname" command line parameter.
In my own build scripts, I "cd" to the folder where the project lives before calling "xcodebuild".