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
1888fa35
Unverified
Commit
1888fa35
authored
Nov 25, 2019
by
Jonah Williams
Committed by
GitHub
Nov 25, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow flutter run to run release/profile x64 (#45511)
parent
e6935efd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
10 deletions
+51
-10
android_device.dart
packages/flutter_tools/lib/src/android/android_device.dart
+3
-4
android_device_test.dart
...tools/test/general.shard/android/android_device_test.dart
+48
-6
No files found.
packages/flutter_tools/lib/src/android/android_device.dart
View file @
1888fa35
...
...
@@ -491,10 +491,9 @@ class AndroidDevice extends Device {
}
final
TargetPlatform
devicePlatform
=
await
targetPlatform
;
if
(!(
devicePlatform
==
TargetPlatform
.
android_arm
||
devicePlatform
==
TargetPlatform
.
android_arm64
)
&&
!
debuggingOptions
.
buildInfo
.
isDebug
)
{
printError
(
'Profile and release builds are only supported on ARM targets.'
);
if
(
devicePlatform
==
TargetPlatform
.
android_x86
&&
!
debuggingOptions
.
buildInfo
.
isDebug
)
{
printError
(
'Profile and release builds are only supported on ARM/x64 targets.'
);
return
LaunchResult
.
failed
();
}
...
...
packages/flutter_tools/test/general.shard/android/android_device_test.dart
View file @
1888fa35
...
...
@@ -94,12 +94,19 @@ void main() {
});
group
(
'startApp'
,
()
{
final
MockAndroidApk
mockApk
=
MockAndroidApk
();
final
MockProcessManager
mockProcessManager
=
MockProcessManager
();
final
MockAndroidSdk
mockAndroidSdk
=
MockAndroidSdk
();
final
MockProcessUtils
mockProcessUtils
=
MockProcessUtils
();
MockAndroidApk
mockApk
;
MockProcessManager
mockProcessManager
;
MockAndroidSdk
mockAndroidSdk
;
MockProcessUtils
mockProcessUtils
;
setUp
(()
{
mockApk
=
MockAndroidApk
();
mockProcessManager
=
MockProcessManager
();
mockAndroidSdk
=
MockAndroidSdk
();
mockProcessUtils
=
MockProcessUtils
();
});
testUsingContext
(
'
succeeds with --cache-sksl'
,
()
async
{
testUsingContext
(
'succeeds with --cache-sksl'
,
()
async
{
const
String
deviceId
=
'1234'
;
final
AndroidDevice
device
=
AndroidDevice
(
deviceId
,
modelID:
'TestModel'
);
...
...
@@ -140,6 +147,41 @@ void main() {
ProcessManager:
()
=>
mockProcessManager
,
ProcessUtils:
()
=>
mockProcessUtils
,
});
testUsingContext
(
'can run a release build on x64'
,
()
async
{
const
String
deviceId
=
'1234'
;
final
AndroidDevice
device
=
AndroidDevice
(
deviceId
,
modelID:
'TestModel'
);
final
Directory
sdkDir
=
MockAndroidSdk
.
createSdkDirectory
();
Config
.
instance
.
setValue
(
'android-sdk'
,
sdkDir
.
path
);
final
File
adbExe
=
fs
.
file
(
getAdbPath
(
androidSdk
));
when
(
mockAndroidSdk
.
licensesAvailable
).
thenReturn
(
true
);
when
(
mockAndroidSdk
.
latestVersion
).
thenReturn
(
MockAndroidSdkVersion
());
when
(
mockProcessManager
.
run
(
<
String
>[
adbExe
.
path
,
'-s'
,
deviceId
,
'shell'
,
'getprop'
],
stdoutEncoding:
latin1
,
stderrEncoding:
latin1
,
)).
thenAnswer
((
_
)
async
{
return
ProcessResult
(
0
,
0
,
'[ro.build.version.sdk]: [24]
\n
[ro.product.cpu.abi]: [x86_64]'
,
''
);
});
final
LaunchResult
launchResult
=
await
device
.
startApp
(
mockApk
,
prebuiltApplication:
true
,
debuggingOptions:
DebuggingOptions
.
disabled
(
const
BuildInfo
(
BuildMode
.
release
,
null
),
),
platformArgs:
<
String
,
dynamic
>{},
);
expect
(
launchResult
.
started
,
true
);
},
overrides:
<
Type
,
Generator
>{
AndroidSdk:
()
=>
mockAndroidSdk
,
FileSystem:
()
=>
MemoryFileSystem
(),
ProcessManager:
()
=>
mockProcessManager
,
ProcessUtils:
()
=>
mockProcessUtils
,
});
});
});
...
...
@@ -378,7 +420,7 @@ Use the 'android' tool to install them:
ProcessManager:
()
=>
mockProcessManager
});
testUsingContext
(
'detects kind fire ABI'
,
()
async
{
testUsingContext
(
'detects kind
le
fire ABI'
,
()
async
{
cpu
=
'arm64-v8a'
;
abilist
=
'arm'
;
final
AndroidDevice
device
=
AndroidDevice
(
'test'
);
...
...
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