Uploading iOS .ipa file to testflight via Jenkins - ios

I might be late to the CI/CD party but better late than never. So far, I am able to setup Jenkins on a separate MAC which does not contain XCode. I use this MAC as a 24x7 small server for minor operations. A lot of time was wasted for archiving and then uploading that build to testflight for my iOS apps so I thought of setting up a CI/CD process.
After the Jenkins setup, I am able to generate the .ipa file for specified target (release/debug).
Now I want to upload this .ipa file to Testflight. This is what I know already:
Via ALTool: As per this answer, I should use AlTool. AlTool is nothing but the Application Loader inside XCode. I don't want to install XCode on this separate MAC, so this is not what I can work with.
Via shell script: If you see the question of the answer in the above point, the user has mentioned a script. I have tried that as well and it fails.
Via Shenzen: This is deprecated. On the Github page itself, they have mentioned to use Fastlane.
Via Testflight plugin: This is also deprecated.
So basically, what I feel is Jenkins alone itself can not distribute iOS builds to testflight, unless we use ALTool which requires XCode to be installed. Is there a workaround to do it purely via Jenkins?

Yes, there is a better option, strongly recommend Fastlane.
You can check here and here is specifically for TestFlight
You need to have Fastlane on the Jenkins but it is execution is easy and fast.
Also as we discussed you can implement connection by yourself using AppStoreConnect API

Fastlane Pilot action is a better option.
You need to add Environment Variables in Jenkins
FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD - This is application-specific password generated on https://appleid.apple.com. Pilot automatically fetches password for a transporter from environment variable named FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD
FASTLANE_PASSWORD This is apple developer account password
Add below command in shell script of Jenkins
fastlane pilot upload — ipa IPA_PATH
Reference link

Related

Continuous integration/deployment iOS Android app

We have developed Xamarin.iOS and Xamarin.Android app using Visual studio.
and we want a way to automate deployment as we have repository on bitbucket
On search we found there are Jenkins, and MacinCloud, Bitrise.
What will be best option to execute following process.
1. Get code from repository .
2. Build ipa,apk for both android and iOS platform.
3. Deploy to Appstore/Testflight.
Do any of above provide facility to configure and deploy app for multiple environment(DEV/ST/PROD).
Thanks
To address your goals 1-by-1:
Get code from repository
You will want a CI/CD tool: Jenkins, Azure Pipelines, Bamboo will help you automate the build process. The first step in most of these tools will be to grab the source code from the repository.
Build ipa,apk for both android and iOS platform
You will need a Mac computer for the .ipa. There is no easy way around this requirement as you need XCode and an Apple developer account in order to build the signed .ipa for iOS deployments. The android apk can be built on pretty much any platform though. Because you will need a Mac, you may end up having to setup a remote agent for your CI/CD service in order to build on that machine.
Deploy to Appstore/Testflight
You can either script this part, use a plugin with your CI/CD tool, or use a 3rd party entirely. Some popular 3rd party options are Microsoft's Appcenter (formally HockeyApp) or Fastlane.
Do any of above provide facility to configure and deploy app for multiple environment(DEV/ST/PROD)?
Yes. All of the CI/CD tools mentioned above support this. Additionally, the Google Play store supports different release tracks, and you can setup different deployment strategies with iOS depending on the tooling you end up selecting.

Continuous Integration with hybrid mobile app

I have a problem. I need to build a job in my Jenkins server hosted by macmini (localhost) to automatic build a deploy for my mobile hybrid apps. That's apps was building with ionic2, and need a deploy for Android (apk) and for iOS (ipa).
But when i run a build from Jenkins, with this shell command
I get this error
that's not all... because i try to execute, from the jenkins folder, the npm i and the result was this:
When i try to build my application from other "folder" and not from jenkins, they works correctly. How i can solve?
Without more information hard to say; you can either just script the things you do when you deploy "manually", or you might want to try a CLI tool like https://www.bitrise.io/cli or https://fastlane.tools which can auto-scan your project and configure a suitable configuration which is then easier to tweak.
In case of Bitrise CLI the base config can be generated with bitrise init in the repo root, and you can also use a visual editor to modify your configuration: https://discuss.bitrise.io/t/how-to-experiment-with-bitrise-configs-locally-on-your-mac-linux/1751
After a lot of time, just find the solution. Jenkins have a own "tools management". So i need to install, into jenkins, a property version of nodeJS, Npm and all other tools i need to deploy the application.
So, first of all you need to install property plugin (in my case nodejs).
After this, going into Jenkins Management System and configure a NodeJS version. That's all

Gitlab CD for iOS on server

I'm trying to create Continuous Deployment pipeline for an iOS project with Gitlab tools.
It's suggested to use own mac in order to run tests and Archive in this tutorial.
So, there, probably, should be a way to create runner on a server, not on own machine, right? Because otherwise the owner of the Apple distribution signature would be the onlyone who can trigger deployment process.

Upload .ipa file using bitrise services w/o xcode

Since I do not own a Apple Mac, I need to upload my .ipa file
which is ready with me to iTunesConnect for putting it
on AppleAppStore ..
Not sure about bitrise workflows etc, since I have joined bitrise
short time back. Will I need to learn workflows and take
the full curve of bitrise learnings?
Is there any easy steps reckoner via bitrise just to deploy an ipa file on appleStore thru iTunesconnect without using Mac/XCode personally ??
Thanks
The recommended way is to build your app (.ipa) with https://www.bitrise.io , as that way the building & code signing of the .ipa is handled automatically.
If you don't want to build your app on bitrise.io and just want to upload it to iTunes Connect, you have two ways to do this depending on where you store your .ipa that you want to send to iTunes Connect.
You store the .ipa in a repository
You store the .ipa elsewhere (Dropbox, Amazon S3, etc.) and you want to download the .ipa from there.
In the first case:
Create a new app on Bitrise with the repository that you use to store the .ipa. (To add a repository which doesn't include an iOS project select the Do you want to configure the build manually? option in the Validation setup section.)
After that go to the Workflow tab, click on the Manage Workflow button and remove all the steps except the Git Clone and the Activate SSH key. (docs for accessing and managing the workflow: http://devcenter.bitrise.io/docs/add-your-first-step-to-your-apps-workflow)
Add a Script Step and after that one of the iTunes Connect Steps (Deliver or Shenzen).
Click on the Script Step and copy this to the content input:
Script:
#!/bin/bash
set -e
set -x
ipa_relative_path_in_repository="${BITRISE_SOURCE_DIR}/relative/path/to.ipa"
envman add --key BITRISE_IPA_PATH --value "${ipa_relative_path_in_repository}"
In the second case:
Create a new app on Bitrise with the repo you use to store your app.
Go to Manage workflow
Remove every step
Add a Script Step and after that one of the iTunes Connect Steps (Deliver or Shenzen).
Click on the Script Step and copy this to the content input:
Script:
#!/bin/bash
set -e
set -x
ipa_download_url="INSERT_YOUR_IPA_DOWNLOAD_URL_HERE"
ipa_download_location="${BITRISE_DEPLOY_DIR}/ipa-to-upload.ipa"
echo "ipa_download_location: ${ipa_download_location}"
wget -O "$ipa_download_location" "$ipa_download_url"
envman add --key BITRISE_IPA_PATH --value "${ipa_download_location}"

Continues Integration with IOS

I am looking for the best way to get my Xcode Apps on CI.
I already have a designated Jenkins server which is Integrated with BitBucket.
I want to know what would be the best option.
Do I use Xcode server or is there a way I can also use my Jenkins server to build my Xcode apps through a slave server that is run on a Mac?
Thank you for your Help.

Resources