Cannot run example flow on Android
Is there an existing issue for this?
- [x] I have searched the existing issues and didn't find mine.
Steps to reproduce
I am follow the doc to run sample :https://docs.maestro.dev/getting-started/run-a-sample-flow
cd ./samples adb install sample.apk maestro test android-flow.yaml
I can see the app was installed successfully, but with exception when I run 'maestro test android-flow.yaml ' , I have try this command by many maestro version.
Tested JDK version : openlogic-openjdk-17.jdk , jdk 17.0.12 , jdk 21.0.9 , jdk 25.0.1 , jdk 17.0.17, jdk 17.0.0 All with this issue.
Actual results
WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for callers in this module WARNING: Restricted methods will be blocked in a future release unless native access is enabled
No content to map due to end-of-input
at [Source: REDACTED (StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION disabled); line: 1]
The stack trace was:
com.fasterxml.jackson.databind.exc.MismatchedInputException: No content to map due to end-of-input
at [Source: REDACTED (StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION disabled); line: 1]
at com.fasterxml.jackson.databind.exc.MismatchedInputException.from(MismatchedInputException.java:59)
at com.fasterxml.jackson.databind.ObjectMapper._initForReading(ObjectMapper.java:4996)
at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4898)
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3848)
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3831)
at util.LocalIOSDevice.listDeviceViaDeviceCtl(LocalIOSDevice.kt:76)
at maestro.device.DeviceService.listIOSConnectedDevices(DeviceService.kt:266)
at maestro.device.DeviceService.listIOSDevices(DeviceService.kt:262)
at maestro.device.DeviceService.listDevices(DeviceService.kt:144)
at maestro.device.DeviceService.listConnectedDevices(DeviceService.kt:130)
at maestro.cli.command.TestCommand.getDeviceIds(TestCommand.kt:304)
at maestro.cli.command.TestCommand.getDeviceCount(TestCommand.kt:295)
at maestro.cli.command.TestCommand.call(TestCommand.kt:263)
at maestro.cli.command.TestCommand.call(TestCommand.kt:74)
at picocli.CommandLine.executeUserObject(CommandLine.java:1953)
at picocli.CommandLine.access$1300(CommandLine.java:145)
at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2358)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2352)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2314)
at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)
at picocli.CommandLine$RunLast.execute(CommandLine.java:2316)
at maestro.cli.DisableAnsiMixin$Companion.executionStrategy(DisableAnsiMixin.kt:22)
at picocli.CommandLine.execute(CommandLine.java:2078)
at maestro.cli.AppKt.main(App.kt:160)
Expected results
app launch
About app
the sample app
About environment
JDK version is : openlogic-openjdk-17.jdk,openlogic-openjdk-17.jdk , jdk 17.0.12 , jdk 21.0.9, 25.0.1 mac os Intel Core i7
Logs
Logs
<!-- Replace this line with your logs. *DO NOT* remove the backticks! -->
Maestro version
2.0.5,1.4.0
How did you install Maestro?
install script (https://get.maestro.mobile.dev)
Anything else?
No response
Does this happen on more mainstream JDKs?
Does this happen on more mainstream JDKs?
yes, I tested on openlogic-openjdk-17.jdk , jdk 17.0.12 , jdk 21.0.9 , jdk 25.0.1 , jdk 17.0.17 , jdk 17.0.0 all have this issue
Any one can give me some suggestions? which java and maestro version are work fine? thanks!
I followed these steps to fix the issue and get Maestro running on Android:
First, I ran:
maestro start-device --platform=android
This produced an error indicating that Android SDK Command-Line Tools were missing:
Missing required component cmdline-tools. To install:
1) Open Android Studio SDK Manager
2) Check "Show package details"
3) Install Android SDK Command-Line Tools (recommended: 11.0)
I opened Android Studio → SDK Manager and installed the Command-Line Tools as suggested.
After that, I ran the command again:
maestro start-device --platform=android
This time I got another message:
The required system image system-images;android-30;google_apis;x86_64 is not installed. Would you like to install it? y/n
I installed the missing system image manually with:
/Users/macbookpro/Library/Android/sdk/cmdline-tools/latest/bin/sdkmanager "system-images;android-30;google_apis;x86_64"
Then I ran again:
maestro start-device --platform=android
This successfully created and launched the emulator:
Created Android emulator: Maestro_Pixel_6_API_30 Launching emulator...
Finally, I was able to run my Maestro test:
maestro test maestro/home.yaml
Until here i knew i was close even if it didn't work
I later downgraded to Maestro 1.40.0, and everything continued to work perfectly. The issue seems to occur only in the newer releases (2.0.x).
✅ Success — Everything is working now! 🎉
@AnasZairig All of your start-device stuff is unrelated. The summary is just "works on an outdated version"?
You haven't included any JDK info or logging that you received - that could be handy for debugging this.
@Fishbowler I'm using this Java version: java 17.0.12 2024-07-16 LTS
So the same verion as @haizhiguang
Just noticed a point part way through your stack trace
at util.LocalIOSDevice.listDeviceViaDeviceCtl(LocalIOSDevice.kt:76)
This definitely shouldn't be trying to do anything with iOS. Can you try this?
maestro --platform android test android-flow.yaml
Just noticed a point part way through your stack trace
at util.LocalIOSDevice.listDeviceViaDeviceCtl(LocalIOSDevice.kt:76)
This definitely shouldn't be trying to do anything with iOS. Can you try this?
maestro --platform android test android-flow.yaml
ok, it seem with the same issue as below:
maestro --platform android test android-flow.yaml
No content to map due to end-of-input
at [Source: REDACTED (StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION disabled); line: 1]
The stack trace was:
com.fasterxml.jackson.databind.exc.MismatchedInputException: No content to map due to end-of-input
at [Source: REDACTED (StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION disabled); line: 1]
at com.fasterxml.jackson.databind.exc.MismatchedInputException.from(MismatchedInputException.java:59)
at com.fasterxml.jackson.databind.ObjectMapper._initForReading(ObjectMapper.java:4996)
at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4898)
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3848)
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3831)
at util.LocalIOSDevice.listDeviceViaDeviceCtl(LocalIOSDevice.kt:76)
at maestro.device.DeviceService.listIOSConnectedDevices(DeviceService.kt:266)
at maestro.device.DeviceService.listIOSDevices(DeviceService.kt:262)
at maestro.device.DeviceService.listDevices(DeviceService.kt:144)
at maestro.device.DeviceService.listConnectedDevices(DeviceService.kt:130)
at maestro.cli.command.TestCommand.getDeviceIds(TestCommand.kt:304)
at maestro.cli.command.TestCommand.getDeviceCount(TestCommand.kt:295)
at maestro.cli.command.TestCommand.call(TestCommand.kt:263)
at maestro.cli.command.TestCommand.call(TestCommand.kt:74)
at picocli.CommandLine.executeUserObject(CommandLine.java:1953)
at picocli.CommandLine.access$1300(CommandLine.java:145)
at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2358)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2352)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2314)
at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)
at picocli.CommandLine$RunLast.execute(CommandLine.java:2316)
at maestro.cli.DisableAnsiMixin$Companion.executionStrategy(DisableAnsiMixin.kt:22)
at picocli.CommandLine.execute(CommandLine.java:2078)
at maestro.cli.AppKt.main(App.kt:160)
% java -version java version "17" 2021-09-14 LTS Java(TM) SE Runtime Environment (build 17+35-LTS-2724) Java HotSpot(TM) 64-Bit Server VM (build 17+35-LTS-2724, mixed mode, sharing)
Out of interest, do you have an iOS Simulator active at the same time?