Closed Almouro closed 1 month ago
Hi @Almouro - are you using Custom test environments in AWS device farm?
If yes, can you share the install
and pre_test
phases of your AWS device farm script?
Hi @vibin, sure here's a simple example to reproduce:
version: 0.1
phases:
install:
commands:
- curl -Ls "https://get.maestro.mobile.dev" | bash
- export PATH="$PATH":"$HOME/.maestro/bin"
- echo YXBwSWQ6IGNvbS5leGFtcGxlCi0tLQotIGxhdW5jaEFwcAotIGFzc2VydFZpc2libGU6IC4qLioK | base64 -d > test.yaml
test:
commands:
- maestro test test.yaml
Hi @vibin, sure here's a simple example to reproduce:
version: 0.1 phases: install: commands: - curl -Ls "https://get.maestro.mobile.dev" | bash - export PATH="$PATH":"$HOME/.maestro/bin" - echo YXBwSWQ6IGNvbS5leGFtcGxlCi0tLQotIGxhdW5jaEFwcAotIGFzc2VydFZpc2libGU6IC4qLioK | base64 -d > test.yaml test: commands: - maestro test test.yaml
Hi @Almouro, you mentioned you tried upgrading ADB. Is that done as part of the install phase? Can you share the snippet for that?
Indeed, here goes:
version: 0.1
phases:
install:
commands:
# Upgrade java
- java -version
- curl -s "https://get.sdkman.io" | bash
- source "$HOME/.sdkman/bin/sdkman-init.sh"
- sdk install java
- echo "Java upgraded"
- java -version
# Upgrade adb
- adb version
- wget https://dl.google.com/android/repository/platform-tools-latest-linux.zip
- unzip platform-tools-latest-linux.zip
- export PATH=$(pwd)/platform-tools:$PATH
- echo "ADB upgraded"
- adb version
# Install Maestro
- curl -Ls "https://get.maestro.mobile.dev" | bash
- export PATH="$PATH":"$HOME/.maestro/bin"
- echo YXBwSWQ6IGNvbS5leGFtcGxlCi0tLQotIGxhdW5jaEFwcAotIGFzc2VydFZpc2libGU6IC4qLioK | base64 -d > test.yaml
test:
commands:
- maestro test test.yaml
I'm also experiencing the same issue.
If I force dadb to use the second version to install an APK (without abb), it works succesfully.
@Almouro can you share some more details on what this means? How is that achieved?
Were you able to find a workaround to get Maestro + AWS DF to work together?
Hi @tomoakley, I think @Almouro is referring to the if-else conditional in the Dadb.install function.
fun install(file: File, vararg options: String) {
if (supportsFeature("abb_exec")) {
abbExec("package", "install", "-S", file.length().toString(), *options).use { stream ->
stream.sink.writeAll(file.source())
stream.sink.flush()
val response = stream.source.readString(Charsets.UTF_8)
if (!response.startsWith("Success")) {
throw IOException("Install failed: $response")
}
}
} else {
val fileName = file.name
val remotePath = "/data/local/tmp/$fileName"
push(file, remotePath)
shell("pm install ${options.joinToString(" ")} \"$remotePath\"")
}
}
More on abb_exec here: https://malinskiy.github.io/adam/docs/abb
Though, how to execute the else branch on Android 10+ remains unknown...
Indeed, we just forked it replacing the condition with if (false)
🙈
Since we have node installed on the aws machine, we run it with npx @perf-profiler/maestro@rc test
instead of just maestro test
thanks @vibin @Almouro, very helpful. Will try using that package and see if it works for me!
edit: it works! thanks so much @Almouro 🎉
@Almouro : can you update @perf-profiler/maestro since its missing --debug-output command
Dadb v1.2.7 replaces abb_exec
with exec:cmd
: https://github.com/mobile-dev-inc/dadb/pull/63
Waiting for Maestro to upgrade Dadb to new version... https://github.com/mobile-dev-inc/maestro/blob/ce0e2f74feecafded81baa727240488436056509/gradle/libs.versions.toml#L19-L21
@axelniklasson @Leland-Takamine Could you please take up the Dadb upgrade in the next Maestro release?
Retested with latest Maestro version and it works for me now 👌🥳
This issue has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar problem, please file a new issue. Make sure to follow the template and provide all the information necessary to reproduce the issue. Thank you for helping keep us our issue tracker clean!
Hi! Thanks for providing Maestro to the community! ❤️
Trying to run Maestro in AWS Device Farm, I've noticed Android devices with version 10 and above will fail to run Maestro (basically devices supporting
abb_exe
)It fails here: https://github.com/mobile-dev-inc/dadb/blob/master/dadb/src/main/kotlin/dadb/Dadb.kt#L85 seemingly printing out the output of running
adb shell cmd package
as if everything afterpackage
was ignored:If I run Dadb from source on AWS, I'm running into the same issue. I can log the commands sent via abb:
For instance, with:
I see:
If I force dadb to use the second version to install an APK (without abb), it works succesfully.
Kinda wondering if there is an issue with the null symbol \u0000 not being recognized somehow on AWS machines. AWS Device Farm runs with Ubuntu 14 LTS / Java 8 / adb 1.0.39. I've upgraded both
java
andadb
and I'm still running in the same issue thoughAny ideas what could be going on, what to try out next?