I've successfully integrated CI on my Mac OS X server, but my bot actually build wrong.
I guess, that it should build archive with selected 'Release' Configuration, but it uses Debug configuration instead. Did someone faced with this?
The bot runs using configurations set the scheme it starts off of. If the scheme sets the archive configuration to Release, the bot should build in Release. Edit the scheme to archive in debug build configuration, and you should see your bot build an archive in debug build configuration.
The following shows the edit scheme window. This scheme's archive phase uses the release build config.
Hm, need to checkmark 'Perform Archive action' when creating/editing bot. This will cause performing Debug->Release Build configuration. If also check 'Perform Analyze/Test action' it will be: Debug->Analyze->Test->Archive.
Related
why xcodebuild building the same application differently for scheme and target options?
xcodebuild -target uConnect build
Above commands builds with Release config in build folder inside
project.
xcodebuild -scheme uConnect build
Above builds with Debug config in Xcode’s DrivedData folder.
Wanted to understand what difference -target and -scheme options are making here?
As per my understanding it should always build the application in Release mode since we have selected Release at Project>>Info>>Configuration
use Release for command-line builds
Reference:
Screenshot of Scheme Details for reference
Try editing the scheme. You will see that it specifies the Debug configuration when building. It might look like this:
But, as you've said, when you build the target, you've specified the Release configuration.
A target describes a product that Xcode will build, like your app, the tests, an App Clip or an Extension. When using -target, it will use the configuration specified in the drop down at the bottom of your screenshot.
A scheme is a configuration that describes how a specific target will be built under different circumstances. If you go to the scheme editor, you'll see that you can choose which configuration to build when running, testing, profiling, analyzing, and archiving.
When using Xcode server to execute UI Tests, the bot has a setting to 'override' the configuration to Release mode.
This was handy as tests would be executed on release build.
Now when I am trying to run tests on TeamCity or CLI and pass the -configuration Release I get an error saying Module 'App name' was not compiled for testing
This can be solved by toggling Enable testability flag for Release configuration in build settings but that will have to be changed back each time before releasing the app.
Creating another build configuration is also not a desirable option as I have a lot of targets and maintaining an extra config for all would be a pain.
So how does Xcode server do this? Is there a CLI param or something I am missing? Or does it just change the setting via a prebuild script?
I am building an iOS app and generating .app file in following two ways:
using Xcode in my machine
Jenkins job set up
In my Jenkins script, I am using the command xcodebuild -configuration "$CONFIGS" to generate the build. Where CONFIGS is set to one of my project configuration. Locally, I am building a scheme which is linked to same configuration.
Problem: .app generated from Jenkins build crashes as soon as I launch the app on certain iOS like 8.4.1; works on certain iOS versions like 7.X. Build generated from my local Xcode works fine on all supported iOS versions.
Diagnosis: On further troubleshooting and build size comparison I found that size of exec file inside .app file from Jenkins is half the size of file generated from my local machine.
Anyone has idea on why there could be size difference in executable files?
As you suspected, an architecture is missing in your app.
Check the Xcode configuration used by Jenkins, especially that the Build Settings Build active architecture only is on No, and that the Valid Architecture contains all the needed architecture (arm64 and armv7).
If you need to change something, do take care of the Debug vs. Release thing -- by default, building on your Mac usually yields a Debug build; it may not be the same on the Jenkins job.
I'm using Cocoapods and KIF to run Continuous Integration on an Xcode server. I have successfully set this up for one project to report on each commit. I'm now using a second project and get the error:
Bot Issue: warning. Build Service Error.
Issue: archive at path '/Library/Developer/XcodeServer/Integrations/Integration-81d42936b22a04037fd4aebed1074e5e/Archive.xcarchive' is malformed.
Integration Number: 1.
Description: archive at path '/Library/Developer/XcodeServer/Integrations/Integration-81d42936b22a04037fd4aebed1074e5e/Archive.xcarchive' is malformed.
The tests passed when ran on the Xcode server machine using Xcode. I tried downloading Provisioning Profiles etc via Xcode but that didn't help. I deleted the Bot and created a new one but that also did't help.
Any help is welcome
At least in my case (and there may be multiple causes), this was caused by having "Skip Install" set on every target, which causes you to end up with an empty archive (but only on Xcode Server).
Basically, xcodebuild (the command-line tool) has lots of critical differences from Xcode in the way it handles archiving. It builds targets that aren't listed in the scheme, and it obeys the Skip Archive flag even for targets listed in the scheme. By contrast, when building locally, Xcode ignores the Skip Archive flag and archives any targets in the scheme (and only the targets listed in the scheme).
I would encourage you to file a bug every time you run into situations where a project builds locally but fails on the server. If everyone did this, perhaps these differences would eventually get fixed....
I managed to setup Crashlytics for an iOS app
Added ./Crashlytics.framework/run <uuid> as a post build step
Then my code uses [Crashlytics startWithAPIKey:<uuid> at startup.
So far it works works.
But since I have a script that changes the CFBundleVersion automatically for every single build, I decided to disable Crashlytics for debug builds, to avoid being spammed by development versions.
I followed these guidlines from the help pages, and changed my script to
releaseConfig="Release"
if [ "$releaseConfig" = "${CONFIGURATION}" ]; then
echo "Running Crashlytics"
./Crashlytics.framework/run {your_api_key_here}
fi
It works. The script only runs only when I use the "Archive" mode of Xcode 5, which is doing release builds.
However, unless I make a normal "Build", the version I archived does not appear in the Crashlytics dashboard, even when I make it crash with [Crashlytics crash] and wait for hours... But if I make a normal "Build" with the same CFBundleVersion, then suddenly my build appears in the dashboard, with all the crashes against the release build. (I know because I report the fact it's a release build with custom keys).
What so different between the "Archive" and "Build" mode? Is this a bug? Has any body managed to make a similar setup work with Crashlytics? What am I missing here?
I know this is an old question, but FYI, the scheme determines the configuration that gets built when archiving. Check your scheme and make sure it's building the "Release" configuration.