How to make multiple iOS Targets in Flutter?
How can I make Flutter run a different Target for iOS that is not the default "Runner"?
ios flutter
add a comment |
How can I make Flutter run a different Target for iOS that is not the default "Runner"?
ios flutter
add a comment |
How can I make Flutter run a different Target for iOS that is not the default "Runner"?
ios flutter
How can I make Flutter run a different Target for iOS that is not the default "Runner"?
ios flutter
ios flutter
asked Oct 10 '18 at 18:21
Daniel OliveiraDaniel Oliveira
3791217
3791217
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
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:
Open your workspace in Xcode - run
open ios/Runner.xcworkspace
in the terminal, from your app's root.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).
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).
Edit the Podfile and copy the entire
target 'Runner' do
section, replacing the name of the target with yours. Afterwards, runpod install
.
Now that you have two different targets, you can do things like set different bundle ids, or include different files.
Run your custom scheme from the command line. For example:
flutter run --flavor Staging
.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
This article is a good cross-platform guide to flavors: medium.com/@salvatoregiordanoo/flavoring-flutter-392aaa875f36
– David Airapetyan
Nov 22 '18 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
Nov 27 '18 at 18:47
add a comment |
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',
autoActivateHeartbeat: false,
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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:
Open your workspace in Xcode - run
open ios/Runner.xcworkspace
in the terminal, from your app's root.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).
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).
Edit the Podfile and copy the entire
target 'Runner' do
section, replacing the name of the target with yours. Afterwards, runpod install
.
Now that you have two different targets, you can do things like set different bundle ids, or include different files.
Run your custom scheme from the command line. For example:
flutter run --flavor Staging
.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
This article is a good cross-platform guide to flavors: medium.com/@salvatoregiordanoo/flavoring-flutter-392aaa875f36
– David Airapetyan
Nov 22 '18 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
Nov 27 '18 at 18:47
add a comment |
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:
Open your workspace in Xcode - run
open ios/Runner.xcworkspace
in the terminal, from your app's root.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).
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).
Edit the Podfile and copy the entire
target 'Runner' do
section, replacing the name of the target with yours. Afterwards, runpod install
.
Now that you have two different targets, you can do things like set different bundle ids, or include different files.
Run your custom scheme from the command line. For example:
flutter run --flavor Staging
.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
This article is a good cross-platform guide to flavors: medium.com/@salvatoregiordanoo/flavoring-flutter-392aaa875f36
– David Airapetyan
Nov 22 '18 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
Nov 27 '18 at 18:47
add a comment |
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:
Open your workspace in Xcode - run
open ios/Runner.xcworkspace
in the terminal, from your app's root.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).
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).
Edit the Podfile and copy the entire
target 'Runner' do
section, replacing the name of the target with yours. Afterwards, runpod install
.
Now that you have two different targets, you can do things like set different bundle ids, or include different files.
Run your custom scheme from the command line. For example:
flutter run --flavor Staging
.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
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:
Open your workspace in Xcode - run
open ios/Runner.xcworkspace
in the terminal, from your app's root.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).
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).
Edit the Podfile and copy the entire
target 'Runner' do
section, replacing the name of the target with yours. Afterwards, runpod install
.
Now that you have two different targets, you can do things like set different bundle ids, or include different files.
Run your custom scheme from the command line. For example:
flutter run --flavor Staging
.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
edited Nov 22 '18 at 0:12
answered Nov 22 '18 at 0:07
David AirapetyanDavid Airapetyan
2,57812338
2,57812338
This article is a good cross-platform guide to flavors: medium.com/@salvatoregiordanoo/flavoring-flutter-392aaa875f36
– David Airapetyan
Nov 22 '18 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
Nov 27 '18 at 18:47
add a comment |
This article is a good cross-platform guide to flavors: medium.com/@salvatoregiordanoo/flavoring-flutter-392aaa875f36
– David Airapetyan
Nov 22 '18 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
Nov 27 '18 at 18:47
This article is a good cross-platform guide to flavors: medium.com/@salvatoregiordanoo/flavoring-flutter-392aaa875f36
– David Airapetyan
Nov 22 '18 at 19:22
This article is a good cross-platform guide to flavors: medium.com/@salvatoregiordanoo/flavoring-flutter-392aaa875f36
– David Airapetyan
Nov 22 '18 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
Nov 27 '18 at 18:47
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
Nov 27 '18 at 18:47
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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