8

I am using xcodebuild command line tool to create an archive and then export as IPA file, for my iOS project.

By default, while using xcodebuild -exportArchive, it creates the IPA file which has the same label as the scheme selected for building.

Is there anyway to change the output IPA file name while using xcodebuild -exportArchive from command line?

Any help will be greatly appreciated. Thanks.

Rashmi Ranjan mallick
  • 6,390
  • 8
  • 42
  • 59
  • See: http://stackoverflow.com/a/19696992/1457385 – shallowThought Nov 29 '16 at 14:14
  • 2
    What I was able to find out is that *ArchiveAction* tag in .xcscheme file can have attribute *customArchiveName* which can be set to anything you like. However, I prefer to avoid this and omit this attr, so that resulting exported IPA is called exactly as the Scheme by which it is built. Then I just `mv` its default name to whatever I need by my CI build script. – RAM237 May 05 '17 at 16:26
  • @RAM237 can you share script and procedure to build ipa with custom name – Darshan Mothreja Jan 21 '19 at 13:42

3 Answers3

5

Change the PRODUCT_NAME in your target's Build Settings.

The parameter that sets your IPA name is actually PRODUCT_MODULE_NAME, which is by default empty and thus defaults to your PRODUCT_NAME.

Rivera
  • 10,792
  • 3
  • 58
  • 102
4

Another way if that's not working is to set the customArchiveName (see this answer) https://stackoverflow.com/a/43809933

StackRunner
  • 1,463
  • 2
  • 16
  • 22
0

set the info.plist -> Bundle name to $(PRODUCT_NAME)

  • 1
    Welcome to Stack Overflow! While this code may solve the question, [including an explanation](//meta.stackexchange.com/q/114762) of how and why this solves the problem would really help to improve the quality of your post, and probably result in more up-votes. Remember that you are answering the question for readers in the future, not just the person asking now. Please [edit] your answer to add explanations and give an indication of what limitations and assumptions apply. – Yunnosch Apr 26 '23 at 17:36