Split up build steps

I am looking to split the build of an Ionic 1 app up into two steps:

  1. Build everything possible on a Linux machine, and
  2. Build the final package on a mac with xcode installed.

What I am really hoping is that it will be possible to run step #2 on a machine that doesn’t have ionic or cordova or anything installed. It’s not completely clear to me what the build steps are and whether this is possible or not. For the record, I am using Fastlane as well.

I have this problem with another app as well, which is using Ionic 3.

Can anyone guide me in the right direction or tell me whether this is possible or not?