-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for physical iOS devices #181
Conversation
This is WIP. Feel free to look around :) I'll tag you as reviewers once it's ready, @iasiu @shilangyu. |
966be92
to
bb638c8
Compare
dcb4e49
to
a79313b
Compare
AutomatorServer/android/app/src/androidTest/java/pl/leancode/automatorserver/Logger.kt
Outdated
Show resolved
Hide resolved
AutomatorServer/ios/run_tests
Outdated
http GET localhost:8081/isRunning | ||
http POST localhost:8081/openApp id='pl.baftek.discoverRudy' | ||
http POST localhost:8081/pressHome || true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent indent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, what is http
? Seems like a non-standard tool, if so, it should be somewhere mentioned as a external dependency probably
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's HTTPie, basically a modern curl
.
I added a comment to this script.
packages/maestro_cli/lib/src/features/drive/ios/ios_driver.dart
Outdated
Show resolved
Hide resolved
packages/maestro_cli/lib/src/features/drive/ios/ios_driver.dart
Outdated
Show resolved
Hide resolved
packages/maestro_cli/lib/src/features/drive/ios/ios_driver.dart
Outdated
Show resolved
Hide resolved
// On iOS, "flutter" is not prefixed | ||
final flutterPrefix = RegExp('flutter: '); | ||
|
||
// On Android, "flutter" is prefixed with "I\" | ||
final flutterWithPortPrefix = RegExp(r'I\/flutter \(\s*[0-9]+\): '); | ||
if (line.startsWith(flutterWithPortPrefix)) { | ||
log.info(line.replaceFirst(flutterWithPortPrefix, '')); | ||
} else if (line.startsWith(flutterPrefix)) { | ||
log.info(line.replaceFirst(flutterPrefix, '')); | ||
} else { | ||
log.fine(text); | ||
log.fine(line); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of these string matching will definitely be a source of bugs :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah :(
Any better ideas?
} else { | ||
p = _defaultArtifactPath; | ||
} | ||
|
||
return p; | ||
} | ||
|
||
String get _defaultArtifactPath => path.join(_homePath, '.maestro'); | ||
String get _defaultArtifactPath => path.join(_homeDirPath, '.maestro'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I forgot about it. Fixed now.
This reverts commit 3687a6e.
5fa8875
to
9e276ec
Compare
deviceJson as Map<String, dynamic>; | ||
|
||
final targetPlatform = deviceJson['targetPlatform'] as String; | ||
if (targetPlatform != 'android-arm64' && targetPlatform != 'ios') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if someone wants to run it on android-x86? or any other architecture supported by android?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, fixed
5c126e5
to
2a09862
Compare
Gonna merge to see how (bad) CI behaves. |
* maestro_cli: list also physical iOS devices * print current IP address * maestro_cli: add temporary "simulator" flag to `maestro drive` * run on public interface * try to handle permission popups * remove commented-out code * refactor touching many areas of the codebase, so sad * fixes * make `iproxy` work * disable `swift-format` action * AutomatorServer/android: minor changes to match iOS server * create `run_tests` script * forward $MAESTRO_PORT to Swift * refactor android AutomatorServer a bit * maestro_cli: refactor ios_driver code * maestro_cli: more refactors * AutomatorServer/ios: fix error catching * AutomatorServer/ios: fix passing `TEST_RUNNER_MAESTRO_PORT` to Swift code * maestro_test: remove `package:logging` * refactor code handling artifacts, create ArtifactsRepository * big refactor + download iOS artifacts * maestro_cli: fix iOS artifacts extracting to a wrong place * fully implement `maestro_cli-publish` workflow for iOS * remove commented-out code in ServerLoop.swift * throw Exception when flutter_driver exits with code != 0 * add docs in `ios/run_tests` script * maestro_cli: change default artifact path to `$HOME/.cache/maestro`
The HTTP server library I used for iOS (Embassy) is way too buggy. I'll have to look for alternatives to replace it. It's probably this HTTP library that causes
SocketException
s on the Dart side.