Running Fastlane Gym build in Rosetta - ios

We have a new M1 MacMini that we want to use for CI/CD purposes. Our main issue is that we have a really old external dependency that doesn't allow us to build the app for the simulator on ARM architecture. We managed to make it build on this machine by running Xcode in Rosetta mode. So as long as we use Rosetta mode with Xcode we can run the app on the simulator with no issues.
Our problem is that we are using Fastlane gym to build the app in our CI/CD flow, so Xcode doesn't run in our flow. We did a lot of research but didn't manage to find a solution that fits our needs.
The question is: Can Fastlane gym run with Rosetta?

Related

Running flutter app in real iOS device [Windows]

I've been searching similar questions but ended up with concerns regarding the actual deployment. I have no problems deploying ios version because I'm using codemagic.
My question here is if it is possible to perform flutter run if I connected an iphone? Like how I use my android device and have USB Debugging enabled.
There are cases that some functions work in android but doesn't in iphone. So if it possible to run my app in an iphone and debug it, I'll just buy an iphone instead of mac since my windows machine is very capable.
Technically you have to own a Mac to build iOS apps. You can use external service to do something similar to what you want though. You will never be able to plug your iPhone to your computer and update your app but you can build an app and install it on your iphone.
For example with Appollo. In this case you have to install Appollo from your CLI
pip install appollo
Then configure Appollo to work with your developer account.
Finally, you can build an IPA file
appollo build start --build-type ad-hoc
appollo build ipa
and you can then install this IPA on your physical device.
No, unfortunately you cannot do this because the one who builds the application for iOS is the Mac machine, not the Windows device. So, the problem here is not in connecting the mobile to Windows, but rather in the reliability of building iOS on Mac devices only.

How to generate an iOS build for a flutter app using Android Studio?

I have a Mac but for some complex reasons that is not worth explaining here, I will be not be able to install xCode. I have checked the tutorial here, where they provide two options. In both options, XCode is used. My question is: Is it possible to generate a build for iOS on a Mac without using XCode.
It is not possible to do this in Android Studio. If you don't have a machine with macOS (or are not able to use XCode in your case), you might be able to make a build using a macOS docker image.
You can find a macOS docker image (Docker-OSX) here (200k downloads). On this page, you can also find container images with XCode installed.
If you don't want to use the XCode app('s GUI) on your machine (or when using this Docker image), but you do have XCode (and Command Line Tools) installed - you can also make a build via the terminal using the xcodebuild command: https://developer.apple.com/library/archive/technotes/tn2339/_index.html
For more on xcodebuild, see this StackOverflow answer.
No, it's not.
What you can do though is use an external tool like appollo which will let you have access to a Mac build machine with XCode installed.
Then you can generate an IPA like this :
appollo build start --build-type ad-hoc
Here are some demo videos or Appollo's documentation

Is it possible to setup Continuous Integration & Continuous Deployment for iOS app development?

I am looking for a way to setup Centralized Continuous Integration and Continuous Deployment for iOS app development. Just like how we do it for Maven or Gradle builds.
I found couple of articles which explains how to achieve this, but for all them are using Xcode to build the iOS application. The key here is Xcode will run only on MacOS.
I found Jenkins Xcode plugin, but it clearly tells,
Obviously, the build machine has to be an OSX machine with XCode
developer tools installed.
Even if we are making one of the developer's OSX machine as Jenkins agent, we can't guarantee that developer's OSX machine will be always connected to Jenkins master. What if somebody else want to build the app and the OSX machine running Jenkins agent is not available?
I found fastlane, but that also seems to automate some of the manual steps like taking screenshots, code signing, releasing the app. It has to be run on only the developers machine if I am not wrong.
What is the generic approach people use to achieve this?
For CI/CD you can use remote build server like AppCenter from Microsoft (https://appcenter.ms/) or other.
And, obviously, without mac machine to build app you can't build your own system CI/CD. Unfortunately, developer can't build app without Apple Machine.
It is main problem for iOS development.
In this case, android is better.

Jenkins - command line build iOS project

I have an iOS project cloned from repo into my jenkins account. Xcode is not yet installed. I know command line scripts to build an iOS project including targets/configurations/profiles etc. Certificate and provisioning profile is installed in jenkins account. I am wondering if there is a way to build and create ipa without installing Xcode in jankins account. Does apple provide any developer tools for building and creating IPA through command line only?
Advance thanks
Every building option for iOS apps requires Xcode, but apple does provide tools for building via CLI. A ton has changed in the most recent iOS OS upgrade and there are incredible tools out there for CI/CD app delivery. What you end up using should really depend on what you want to maintain over time and how advanced your system needs to be.
To get Builds working in Jenkins
Step 1 : Install Xcode on the Jenkins node that will be doing the builds. You wont be using the Xcode UI but you will need it installed, there is currently no way to build IPAs without Xcode.
Step 2: Choose your build tool
You could write your own build scipts and manage provisioning profiles on the machine. xcodebuild is the CLI tool you are looking for. If you end up going down this route make sure to use xcpretty or you will loose your mind with giant build logs.
Fastlane is an amazing toolset for building mobile apps, it might change your life. Check out these examples and how to get started.
Apple has an xcode build server that Jenkins could possibly talk to.
The first two in this list do a good job of managing provisioning profiles out of the box, and that can save you major headaches down the road if you need to scale

Is OSX essential to run xCodeBuild, or could it run on a unix/linux box

I've not been able to find a definitive answer to this so far, does XCodeBuild have to run on OS X in order to build iOS apps, or could it run on unix/linux?
The intention is to get it set up with Jenkins for continuous integration.
At work we run all continuous integration on Mac servers despite being a Linux-only office. There is no availability of the Xcode tools on Linux. Even then the best support for those tools is only of the latest version of Mac OS.

Resources