FreeNickname FreeNickname - 6 months ago 14
iOS Question

How to make deliver (fastlane) download metadata for multiple targets?

I have an Xcode project with six targets, each target is made to build a separate app. I'm trying to setup fastlane to assist me in publication of these apps.

Fastlane docs suggest using .env files in order to handle multiple targets (you can specify

app_identifier
,
team_name
, etc. in different .env files, and then, for instance, call
fastlane appstore --env ENV_NAME_HERE
). However I can't figure out how to set up
deliver
properly.

deliver init
downloads metadata for one target only by default. I need to download metadata for all my targets to different directories (and then use those directories to upload data, obviously).
deliver download_metadata
doesn't accept the
--env
parameter (my Deliverfile depends on env files). I've tried
fastlane deliver --env
, but it seems to be just a shorthand for
deliver
, so it doesn't work either.

I guess I could just manually run
deliver
with different
--metadata_path
parameters (and all the other parameters since my Deliverfile is invalid, because it depends on env files), and then later specify directories using Deliverfile + .env files. But since I have Deliverfile and .env files already set up (now I use
deliver
to upload the binary only), I hoped that there is a better way. Is there?

P.S. This is a large legacy project, so splitting it into six different projects would be great, but it's not an option, unfortunately.

Answer

I've been struggling with this as well and setting up the submit is easy using the .env files.

But retrieving the initial data is difficult, but not impossible.

To grab the metadata it ran this command:

deliver download_metadata -m "./Targets/Release/Metadata" -u "itunes@username" -p "com.example.ios"

And for the screenshots:

deliver download_screenshots -w "./Targets/Release/Metadata" -u "itunes@username" -p "com.example.ios"