Search code examples
iosswiftxcode6software-distribution

iOS Swift: How to build two different .ipa for different countries on the same project


I'm writing an iOS app in Swift. The app is simple, just a UIWebView connected to an URL.

class ViewController: UIViewController {
    @IBOutlet weak var customWebView: UIWebView!

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
        if let url = NSURL(string: "http://A_COUNTRY_URL") {
            let request = NSURLRequest(URL: url)
            customWebView.loadRequest(request)
        }

    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }

}
  1. I want to keep this in one repository (one project)
  2. http://A_COUNTRY_URL is for the .ipa distributed to A country
  3. There's another country B needs to be distributed, and the URL is http://B_COUNTRY_URL
  4. The two different .ipa should have two different Bundle ID

Is it possible to build two different .ipa for one project on Xcode? If yes, how to do that?

Thanks in advance. Eric


Solution

  • In this tutorial, Ray Wenderlich http://www.raywenderlich.com/68613/create-paid-lite-version-iphone-app explains how to make two versions of an app, one paid and one lite using differents targets as better approach.

    Hope it helps!