How to make multiple iOS Targets in Flutter?
up vote
2
down vote
favorite
How can I make Flutter run a different Target for iOS that is not the default "Runner"?
ios flutter
add a comment |
up vote
2
down vote
favorite
How can I make Flutter run a different Target for iOS that is not the default "Runner"?
ios flutter
add a comment |
up vote
2
down vote
favorite
up vote
2
down vote
favorite
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 at 18:21
Daniel Oliveira
3151216
3151216
add a comment |
add a comment |
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:
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 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
add a comment |
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:
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 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
add a comment |
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:
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 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
add a comment |
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:
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 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
add a comment |
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
add a comment |
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