How to make multiple iOS Targets in Flutter?











up vote
2
down vote

favorite
1












How can I make Flutter run a different Target for iOS that is not the default "Runner"?










share|improve this question


























    up vote
    2
    down vote

    favorite
    1












    How can I make Flutter run a different Target for iOS that is not the default "Runner"?










    share|improve this question
























      up vote
      2
      down vote

      favorite
      1









      up vote
      2
      down vote

      favorite
      1






      1





      How can I make Flutter run a different Target for iOS that is not the default "Runner"?










      share|improve this question













      How can I make Flutter run a different Target for iOS that is not the default "Runner"?







      ios flutter






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Oct 10 at 18:21









      Daniel Oliveira

      3151216




      3151216
























          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          That's going to be tricky. If you look at the output of flutter run --help command, you will see that it supports a custom --flavor option that allows you to specify a custom scheme.



          However, several things need to be done in order to make it work:




          1. Open your workspace in Xcode - run open ios/Runner.xcworkspace in the terminal, from your app's root.


          2. Clone the Runner target by expanding the project and target list, clicking on the Runner project and selecting Duplicate (more details here).



          This should create a custom scheme for you as well, with its own Info.plist file. The scheme will be called Runner-copy by default, rename it to what you named your new target (e.g. Staging).




          1. Duplicate your debug and release build configurations and name them the way Flutter expects them to be named. For example, if your new target is called "Staging", you need to create a Debug-Staging and Release-Staging build configurations (more details on doing this).


          2. Edit the Podfile and copy the entire target 'Runner' do section, replacing the name of the target with yours. Afterwards, run pod install.



          Now that you have two different targets, you can do things like set different bundle ids, or include different files.




          1. Run your custom scheme from the command line. For example: flutter run --flavor Staging.


          2. If step #5 failed, re-run pod install manually, open the workspace in Xcode and run from there.



          Note: this is pretty fragile, use at your own risk



          Note: I was not able to get this to run in release mode






          share|improve this answer























          • This article is a good cross-platform guide to flavors: medium.com/@salvatoregiordanoo/flavoring-flutter-392aaa875f36
            – David Airapetyan
            Nov 22 at 19:22










          • A few more comments: 1. You might have to setup additional configurations by copying Flutter/Debug.xcconfig and Flutter/Release.xcconfig, then adding them to the project 2. With those, CocoaPods may complain - this has a good workaround: github.com/CocoaPods/CocoaPods/issues/2633 3. If building in Xcode, it may complain about missing /packages/flutter_tools/bin/xcode_backend.sh - if it's the case, set the FLUTTER_ROOT environment variable to point to the Flutter installation 4. Flutter expects the .app file to be called Runner.app - might have to deploy via ideviceinstaller
            – David Airapetyan
            yesterday











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














           

          draft saved


          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f52746529%2fhow-to-make-multiple-ios-targets-in-flutter%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          0
          down vote













          That's going to be tricky. If you look at the output of flutter run --help command, you will see that it supports a custom --flavor option that allows you to specify a custom scheme.



          However, several things need to be done in order to make it work:




          1. Open your workspace in Xcode - run open ios/Runner.xcworkspace in the terminal, from your app's root.


          2. Clone the Runner target by expanding the project and target list, clicking on the Runner project and selecting Duplicate (more details here).



          This should create a custom scheme for you as well, with its own Info.plist file. The scheme will be called Runner-copy by default, rename it to what you named your new target (e.g. Staging).




          1. Duplicate your debug and release build configurations and name them the way Flutter expects them to be named. For example, if your new target is called "Staging", you need to create a Debug-Staging and Release-Staging build configurations (more details on doing this).


          2. Edit the Podfile and copy the entire target 'Runner' do section, replacing the name of the target with yours. Afterwards, run pod install.



          Now that you have two different targets, you can do things like set different bundle ids, or include different files.




          1. Run your custom scheme from the command line. For example: flutter run --flavor Staging.


          2. If step #5 failed, re-run pod install manually, open the workspace in Xcode and run from there.



          Note: this is pretty fragile, use at your own risk



          Note: I was not able to get this to run in release mode






          share|improve this answer























          • This article is a good cross-platform guide to flavors: medium.com/@salvatoregiordanoo/flavoring-flutter-392aaa875f36
            – David Airapetyan
            Nov 22 at 19:22










          • A few more comments: 1. You might have to setup additional configurations by copying Flutter/Debug.xcconfig and Flutter/Release.xcconfig, then adding them to the project 2. With those, CocoaPods may complain - this has a good workaround: github.com/CocoaPods/CocoaPods/issues/2633 3. If building in Xcode, it may complain about missing /packages/flutter_tools/bin/xcode_backend.sh - if it's the case, set the FLUTTER_ROOT environment variable to point to the Flutter installation 4. Flutter expects the .app file to be called Runner.app - might have to deploy via ideviceinstaller
            – David Airapetyan
            yesterday















          up vote
          0
          down vote













          That's going to be tricky. If you look at the output of flutter run --help command, you will see that it supports a custom --flavor option that allows you to specify a custom scheme.



          However, several things need to be done in order to make it work:




          1. Open your workspace in Xcode - run open ios/Runner.xcworkspace in the terminal, from your app's root.


          2. Clone the Runner target by expanding the project and target list, clicking on the Runner project and selecting Duplicate (more details here).



          This should create a custom scheme for you as well, with its own Info.plist file. The scheme will be called Runner-copy by default, rename it to what you named your new target (e.g. Staging).




          1. Duplicate your debug and release build configurations and name them the way Flutter expects them to be named. For example, if your new target is called "Staging", you need to create a Debug-Staging and Release-Staging build configurations (more details on doing this).


          2. Edit the Podfile and copy the entire target 'Runner' do section, replacing the name of the target with yours. Afterwards, run pod install.



          Now that you have two different targets, you can do things like set different bundle ids, or include different files.




          1. Run your custom scheme from the command line. For example: flutter run --flavor Staging.


          2. If step #5 failed, re-run pod install manually, open the workspace in Xcode and run from there.



          Note: this is pretty fragile, use at your own risk



          Note: I was not able to get this to run in release mode






          share|improve this answer























          • This article is a good cross-platform guide to flavors: medium.com/@salvatoregiordanoo/flavoring-flutter-392aaa875f36
            – David Airapetyan
            Nov 22 at 19:22










          • A few more comments: 1. You might have to setup additional configurations by copying Flutter/Debug.xcconfig and Flutter/Release.xcconfig, then adding them to the project 2. With those, CocoaPods may complain - this has a good workaround: github.com/CocoaPods/CocoaPods/issues/2633 3. If building in Xcode, it may complain about missing /packages/flutter_tools/bin/xcode_backend.sh - if it's the case, set the FLUTTER_ROOT environment variable to point to the Flutter installation 4. Flutter expects the .app file to be called Runner.app - might have to deploy via ideviceinstaller
            – David Airapetyan
            yesterday













          up vote
          0
          down vote










          up vote
          0
          down vote









          That's going to be tricky. If you look at the output of flutter run --help command, you will see that it supports a custom --flavor option that allows you to specify a custom scheme.



          However, several things need to be done in order to make it work:




          1. Open your workspace in Xcode - run open ios/Runner.xcworkspace in the terminal, from your app's root.


          2. Clone the Runner target by expanding the project and target list, clicking on the Runner project and selecting Duplicate (more details here).



          This should create a custom scheme for you as well, with its own Info.plist file. The scheme will be called Runner-copy by default, rename it to what you named your new target (e.g. Staging).




          1. Duplicate your debug and release build configurations and name them the way Flutter expects them to be named. For example, if your new target is called "Staging", you need to create a Debug-Staging and Release-Staging build configurations (more details on doing this).


          2. Edit the Podfile and copy the entire target 'Runner' do section, replacing the name of the target with yours. Afterwards, run pod install.



          Now that you have two different targets, you can do things like set different bundle ids, or include different files.




          1. Run your custom scheme from the command line. For example: flutter run --flavor Staging.


          2. If step #5 failed, re-run pod install manually, open the workspace in Xcode and run from there.



          Note: this is pretty fragile, use at your own risk



          Note: I was not able to get this to run in release mode






          share|improve this answer














          That's going to be tricky. If you look at the output of flutter run --help command, you will see that it supports a custom --flavor option that allows you to specify a custom scheme.



          However, several things need to be done in order to make it work:




          1. Open your workspace in Xcode - run open ios/Runner.xcworkspace in the terminal, from your app's root.


          2. Clone the Runner target by expanding the project and target list, clicking on the Runner project and selecting Duplicate (more details here).



          This should create a custom scheme for you as well, with its own Info.plist file. The scheme will be called Runner-copy by default, rename it to what you named your new target (e.g. Staging).




          1. Duplicate your debug and release build configurations and name them the way Flutter expects them to be named. For example, if your new target is called "Staging", you need to create a Debug-Staging and Release-Staging build configurations (more details on doing this).


          2. Edit the Podfile and copy the entire target 'Runner' do section, replacing the name of the target with yours. Afterwards, run pod install.



          Now that you have two different targets, you can do things like set different bundle ids, or include different files.




          1. Run your custom scheme from the command line. For example: flutter run --flavor Staging.


          2. If step #5 failed, re-run pod install manually, open the workspace in Xcode and run from there.



          Note: this is pretty fragile, use at your own risk



          Note: I was not able to get this to run in release mode







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 22 at 0:12

























          answered Nov 22 at 0:07









          David Airapetyan

          2,50312338




          2,50312338












          • This article is a good cross-platform guide to flavors: medium.com/@salvatoregiordanoo/flavoring-flutter-392aaa875f36
            – David Airapetyan
            Nov 22 at 19:22










          • A few more comments: 1. You might have to setup additional configurations by copying Flutter/Debug.xcconfig and Flutter/Release.xcconfig, then adding them to the project 2. With those, CocoaPods may complain - this has a good workaround: github.com/CocoaPods/CocoaPods/issues/2633 3. If building in Xcode, it may complain about missing /packages/flutter_tools/bin/xcode_backend.sh - if it's the case, set the FLUTTER_ROOT environment variable to point to the Flutter installation 4. Flutter expects the .app file to be called Runner.app - might have to deploy via ideviceinstaller
            – David Airapetyan
            yesterday


















          • This article is a good cross-platform guide to flavors: medium.com/@salvatoregiordanoo/flavoring-flutter-392aaa875f36
            – David Airapetyan
            Nov 22 at 19:22










          • A few more comments: 1. You might have to setup additional configurations by copying Flutter/Debug.xcconfig and Flutter/Release.xcconfig, then adding them to the project 2. With those, CocoaPods may complain - this has a good workaround: github.com/CocoaPods/CocoaPods/issues/2633 3. If building in Xcode, it may complain about missing /packages/flutter_tools/bin/xcode_backend.sh - if it's the case, set the FLUTTER_ROOT environment variable to point to the Flutter installation 4. Flutter expects the .app file to be called Runner.app - might have to deploy via ideviceinstaller
            – David Airapetyan
            yesterday
















          This article is a good cross-platform guide to flavors: medium.com/@salvatoregiordanoo/flavoring-flutter-392aaa875f36
          – David Airapetyan
          Nov 22 at 19:22




          This article is a good cross-platform guide to flavors: medium.com/@salvatoregiordanoo/flavoring-flutter-392aaa875f36
          – David Airapetyan
          Nov 22 at 19:22












          A few more comments: 1. You might have to setup additional configurations by copying Flutter/Debug.xcconfig and Flutter/Release.xcconfig, then adding them to the project 2. With those, CocoaPods may complain - this has a good workaround: github.com/CocoaPods/CocoaPods/issues/2633 3. If building in Xcode, it may complain about missing /packages/flutter_tools/bin/xcode_backend.sh - if it's the case, set the FLUTTER_ROOT environment variable to point to the Flutter installation 4. Flutter expects the .app file to be called Runner.app - might have to deploy via ideviceinstaller
          – David Airapetyan
          yesterday




          A few more comments: 1. You might have to setup additional configurations by copying Flutter/Debug.xcconfig and Flutter/Release.xcconfig, then adding them to the project 2. With those, CocoaPods may complain - this has a good workaround: github.com/CocoaPods/CocoaPods/issues/2633 3. If building in Xcode, it may complain about missing /packages/flutter_tools/bin/xcode_backend.sh - if it's the case, set the FLUTTER_ROOT environment variable to point to the Flutter installation 4. Flutter expects the .app file to be called Runner.app - might have to deploy via ideviceinstaller
          – David Airapetyan
          yesterday


















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f52746529%2fhow-to-make-multiple-ios-targets-in-flutter%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          What visual should I use to simply compare current year value vs last year in Power BI desktop

          Alexandru Averescu

          Trompette piccolo