Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
74c6237a
Commit
74c6237a
authored
May 01, 2019
by
Victor Maraccini
Committed by
Jonah Williams
May 01, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bundle id on iOS launch using flutter run (#31039)
parent
6a1468db
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
1 deletion
+41
-1
simulators.dart
packages/flutter_tools/lib/src/ios/simulators.dart
+10
-1
simulators_test.dart
packages/flutter_tools/test/ios/simulators_test.dart
+31
-0
No files found.
packages/flutter_tools/lib/src/ios/simulators.dart
View file @
74c6237a
...
...
@@ -23,6 +23,7 @@ import '../project.dart';
import
'../protocol_discovery.dart'
;
import
'ios_workflow.dart'
;
import
'mac.dart'
;
import
'plist_utils.dart'
;
const
String
_xcrunPath
=
'/usr/bin/xcrun'
;
...
...
@@ -343,7 +344,15 @@ class IOSSimulator extends Device {
// Launch the updated application in the simulator.
try
{
await
SimControl
.
instance
.
launch
(
id
,
package
.
id
,
args
);
// Use the built application's Info.plist to get the bundle identifier,
// which should always yield the correct value and does not require
// parsing the xcodeproj or configuration files.
// See https://github.com/flutter/flutter/issues/31037 for more information.
final
IOSApp
iosApp
=
package
;
final
String
plistPath
=
fs
.
path
.
join
(
iosApp
.
simulatorBundlePath
,
'Info.plist'
);
final
String
bundleIdentifier
=
iosWorkflow
.
getPlistValueFromFile
(
plistPath
,
kCFBundleIdentifierKey
);
await
SimControl
.
instance
.
launch
(
id
,
bundleIdentifier
,
args
);
}
catch
(
error
)
{
printError
(
'
$error
'
);
return
LaunchResult
.
failed
();
...
...
packages/flutter_tools/test/ios/simulators_test.dart
View file @
74c6237a
...
...
@@ -6,10 +6,12 @@ import 'dart:async';
import
'dart:io'
show
ProcessResult
,
Process
;
import
'package:file/file.dart'
;
import
'package:flutter_tools/src/build_info.dart'
;
import
'package:file/memory.dart'
;
import
'package:flutter_tools/src/device.dart'
;
import
'package:flutter_tools/src/application_package.dart'
;
import
'package:flutter_tools/src/base/file_system.dart'
;
import
'package:flutter_tools/src/ios/ios_workflow.dart'
;
import
'package:flutter_tools/src/ios/mac.dart'
;
import
'package:flutter_tools/src/ios/simulators.dart'
;
import
'package:flutter_tools/src/project.dart'
;
...
...
@@ -26,6 +28,8 @@ class MockIMobileDevice extends Mock implements IMobileDevice {}
class
MockProcess
extends
Mock
implements
Process
{}
class
MockProcessManager
extends
Mock
implements
ProcessManager
{}
class
MockXcode
extends
Mock
implements
Xcode
{}
class
MockSimControl
extends
Mock
implements
SimControl
{}
class
MockIOSWorkflow
extends
Mock
implements
IOSWorkflow
{}
void
main
(
)
{
FakePlatform
osx
;
...
...
@@ -417,6 +421,33 @@ void main() {
});
});
group
(
'startApp'
,
()
{
SimControl
simControl
;
setUp
(()
{
simControl
=
MockSimControl
();
});
testUsingContext
(
"startApp uses compiled app's Info.plist to find CFBundleIdentifier"
,
()
async
{
final
IOSSimulator
device
=
IOSSimulator
(
'x'
,
name:
'iPhone SE'
,
category:
'iOS 11.2'
);
when
(
iosWorkflow
.
getPlistValueFromFile
(
any
,
any
)).
thenReturn
(
'correct'
);
final
Directory
mockDir
=
fs
.
currentDirectory
;
final
IOSApp
package
=
PrebuiltIOSApp
(
projectBundleId:
'incorrect'
,
bundleName:
'name'
,
bundleDir:
mockDir
);
const
BuildInfo
mockInfo
=
BuildInfo
(
BuildMode
.
debug
,
'flavor'
);
final
DebuggingOptions
mockOptions
=
DebuggingOptions
.
disabled
(
mockInfo
);
await
device
.
startApp
(
package
,
prebuiltApplication:
true
,
debuggingOptions:
mockOptions
);
verify
(
simControl
.
launch
(
any
,
'correct'
,
any
));
},
overrides:
<
Type
,
Generator
>{
SimControl:
()
=>
simControl
,
IOSWorkflow:
()
=>
MockIOSWorkflow
()
},
);
});
testUsingContext
(
'IOSDevice.isSupportedForProject is true on module project'
,
()
async
{
fs
.
file
(
'pubspec.yaml'
)
..
createSync
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment