Xamarim iOS building with Jenkins-agent

Hello!

I’ve installed a Jenkins master at a iMac and successfully created a job to build iOS app and publish from Xamarim project.
But I need to use a Windows Server Jenkins to make the same by setting a Jenkins-agent node running on this same iMac, but the project build didn’t work.
I reduced the erros by setting the same iMac PATH variable content in the node configuration screen, but I still getting the following erros:

"/Users/fabricacrm/JenkinsAgent/workspace/CRMMobile/iOSBuild/smart/CRM_Mobile.iOS/CRM_Mobile.iOS.sln" (Build target) (1) ->
"/Users/fabricacrm/JenkinsAgent/workspace/CRMMobile/iOSBuild/smart/CRM_Mobile.iOS/CRM_Mobile.iOS/CRM_Mobile.iOS.csproj" (default target) (2) ->
(_CodesignAppBundle target) -> 
  /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.Shared.targets(2093,3): error : /usr/bin/codesign exited with code 1: [/Users/fabricacrm/JenkinsAgent/workspace/CRMMobile/iOSBuild/smart/CRM_Mobile.iOS/CRM_Mobile.iOS/CRM_Mobile.iOS.csproj]
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.Shared.targets(2093,3): error : /Users/fabricacrm/JenkinsAgent/workspace/CRMMobile/iOSBuild/smart/CRM_Mobile.iOS/CRM_Mobile.iOS/bin/iPhone/Release/CRM_MobileiOS.app: errSecInternalComponent [/Users/fabricacrm/JenkinsAgent/workspace/CRMMobile/iOSBuild/smart/CRM_Mobile.iOS/CRM_Mobile.iOS/CRM_Mobile.iOS.csproj]
  /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.Shared.targets(2093,3): error : Failed to codesign '/Users/fabricacrm/JenkinsAgent/workspace/CRMMobile/iOSBuild/smart/CRM_Mobile.iOS/CRM_Mobile.iOS/bin/iPhone/Release/CRM_MobileiOS.app': /Users/fabricacrm/JenkinsAgent/workspace/CRMMobile/iOSBuild/smart/CRM_Mobile.iOS/CRM_Mobile.iOS/bin/iPhone/Release/CRM_MobileiOS.app: errSecInternalComponent [/Users/fabricacrm/JenkinsAgent/workspace/CRMMobile/iOSBuild/smart/CRM_Mobile.iOS/CRM_Mobile.iOS/CRM_Mobile.iOS.csproj]
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.Shared.targets(2093,3): error :  [/Users/fabricacrm/JenkinsAgent/workspace/CRMMobile/iOSBuild/smart/CRM_Mobile.iOS/CRM_Mobile.iOS/CRM_Mobile.iOS.csproj]
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.Shared.targets(2093,3): error :          [/Users/fabricacrm/JenkinsAgent/workspace/CRMMobile/iOSBuild/smart/CRM_Mobile.iOS/CRM_Mobile.iOS/CRM_Mobile.iOS.csproj]

    471 Warning(s)
    2 Error(s)

All work well at the iMac Jenkins instance, I only get these erros on Jenkins node.

1 Like

if i remember my ios dev days correctly. This is per user. So you’ll have to copy your code sign configs to the agent that jenkins is using.

1 Like

Hi Halkeye!

I added a security unlock-keychain command to my pipeline and It works! Look at how:

sh label: 'Building iOS package', script: """
   security unlock-keychain -p '******' login.keychain

   msbuild /p:Configuration='Release' /p:Platform='iPhone' /t:Build ./ProjectDir/Project.iOS.sln
"""

Thank you so much!

1 Like

Thanks a lot for your feedback @laudivan .

1 Like