maestro icon indicating copy to clipboard operation
maestro copied to clipboard

Error when trying to run iOS test

Open matthewmturner opened this issue 2 years ago • 13 comments

I followed the install directions and have a simulator running with idb_companion but i get the following error when running maestro test test_flow.yaml. Originally I was getting an error about missing java so i installed that with brew.

java.lang.IllegalStateException: No devices found. Select a platform by passing --platform <android|ios> for more details
	at maestro.cli.util.MaestroFactory.autoDetectPlatform(MaestroFactory.kt:78)
	at maestro.cli.util.MaestroFactory.createMaestro(MaestroFactory.kt:34)
	at maestro.cli.command.TestCommand.call(TestCommand.kt:58)
	at maestro.cli.command.TestCommand.call(TestCommand.kt:30)
	at picocli.CommandLine.executeUserObject(CommandLine.java:1933)
	at picocli.CommandLine.access$1200(CommandLine.java:145)
	at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2332)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2326)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2291)
	at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2159)
	at picocli.CommandLine.execute(CommandLine.java:2058)
	at maestro.cli.AppKt.main(App.kt:94)

and this is my test_flow.yaml file.

AppId: com.reactjs.native.Versd-Dev
---
- launchApp
- tapOn: "Text on the screen"

matthewmturner avatar Oct 15 '22 22:10 matthewmturner

Actually when i run maestro test test_flow.yaml it causes idb_companion to crash with the following error:

IDB Companion Built at Aug 12 2022 08:41:50
IDB Companion architecture arm64
Providing targets across Simulator and Device sets.
CoreSimulator: Loading from /Library/Developer/PrivateFrameworks/CoreSimulator.framework
CoreSimulator: Successfully loaded
CoreSimulator: SimDevice has correct path of /Library/Developer
AccessibilityPlatformTranslation: Already loaded, skipping
AccessibilityPlatformTranslation: AXPTranslationObject has correct path of /System/Library
Loaded All Private Frameworks [CoreSimulator, AccessibilityPlatformTranslation]
MobileDevice: Loading from /System/Library/PrivateFrameworks/MobileDevice.framework
MobileDevice: Successfully loaded
Loaded All Private Frameworks [MobileDevice]
[framework_loader] MobileDevice: Loading from /System/Library/PrivateFrameworks/MobileDevice.framework
[framework_loader] MobileDevice: Successfully loaded
[framework_loader] Loaded All Private Frameworks [MobileDevice]
Oct 15 19:00:53  idb_companion[16380] <Notice>: _SubscribeForMuxNotifications (thread 0x10299fd40): returned 0x0.
Starting swift server on tcp port 10882
Swift server started on [IPv6]::/:::10882
{"grpc_swift_port":10882,"grpc_port":10882}
Companion will stay alive if target goes offline
Start of describe
dyld: lazy symbol binding failed: can't resolve symbol _$sScCMa in /opt/homebrew/Cellar/idb-companion/1.1.8/bin/../Frameworks/IDBGRPCSwift.framework/Versions/A/IDBGRPCSwift because dependent dylib @rpath/libswift_Concurrency.dylib could not be loaded
dyld: can't resolve symbol _$sScCMa in /opt/homebrew/Cellar/idb-companion/1.1.8/bin/../Frameworks/IDBGRPCSwift.framework/Versions/A/IDBGRPCSwift because dependent dylib @rpath/libswift_Concurrency.dylib could not be loaded
Abort trap: 6

matthewmturner avatar Oct 15 '22 23:10 matthewmturner

@matthewmturner out of curiosity are you using idb_companion to connect to a simulator or real device?

I'm toying with maestro and have only used sims for the time being which connect + launch the tests successfully. (I say "launch" because that part is true, but actually performing the test steps for me is a different story 😅 ... "

alexandlazaris avatar Oct 16 '22 11:10 alexandlazaris

@matthewmturner out of curiosity are you using idb_companion to connect to a simulator or real device?

I'm toying with maestro and have only used sims for the time being which connect + launch the tests successfully. (I say "launch" because that part is true, but actually performing the test steps for me is a different story 😅 ... "

I'm connecting to simulator although I confess I had never used idb_companion before this so maybe I've done something wrong

matthewmturner avatar Oct 16 '22 11:10 matthewmturner

I'm having a similar issue, no matter if it's a sim or device 🙏

maestro --platform ios test flow.yaml
com.github.michaelbull.result.UnwrapException: kotlin.Unit io.grpc.StatusRuntimeException: UNAVAILABLE: io exception
	at maestro.drivers.IOSDriver.open(IOSDriver.kt:50)
	at maestro.Maestro$Companion.ios(Maestro.kt:401)
	at maestro.Maestro$Companion.ios(Maestro.kt:396)
	at maestro.cli.util.MaestroFactory.createIos(MaestroFactory.kt:68)
	at maestro.cli.util.MaestroFactory.createMaestro(MaestroFactory.kt:39)
	at maestro.cli.command.TestCommand.call(TestCommand.kt:58)
	at maestro.cli.command.TestCommand.call(TestCommand.kt:30)
	at picocli.CommandLine.executeUserObject(CommandLine.java:1933)
	at picocli.CommandLine.access$1200(CommandLine.java:145)
	at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2332)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2326)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2291)
	at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2159)
	at picocli.CommandLine.execute(CommandLine.java:2058)
	at maestro.cli.AppKt.main(App.kt:94)

rborn avatar Oct 20 '22 08:10 rborn

meh, ignore me, I forgot to idb_companion --udid {id of the iOS device} 😢

rborn avatar Oct 20 '22 08:10 rborn

@matthewmturner perhaps use a simple example to confirm it's all working and go from there

For my experiment, I used:

  • maestro v1.9.0
  • iOS simulator v14
  • Xcode 14.0.1
  • app under test was iMessage
appId: com.apple.MobileSMS
---
- launchApp

alexandlazaris avatar Oct 21 '22 02:10 alexandlazaris

I am a bit confused how to run the app, My starting flow is not working. I am having this app downloaded on my simulator. But it can not trigger it to start. Android works fine when it gets the apk.

Saad-Bashar avatar Oct 21 '22 07:10 Saad-Bashar

  • you need to have idb_companion installed on your computer
  • run idb list-targets to find the id of the started simulator ( needs to be in booted state)
  • run idb_companion --udid {id of the iOS device} with the id you just found
  • in another terminal run maestro test test_flow.yaml (or whatever your test file is named)

Hope it helps :)

rborn avatar Oct 21 '22 12:10 rborn

I have an issue where this exact crash happening. I figure it out that it was crashing in a iOS 16 SIM (isn't supported yet https://maestro.mobile.dev/troubleshooting/known-issues) So check that versions are < iOS 16

BTW I've downloaded python 3 using the web: https://www.python.org/downloads/

image

Followed the instructions from https://github.com/facebook/idb to get the UUID of the device (although you can find them using the organiser) but I used the pip 3.10 version instead.

pip3.10 install fb-idb

phynet avatar Oct 24 '22 10:10 phynet

the issue with ios 16 seems to be on the idb side https://maestro.mobile.dev/troubleshooting/known-issues

rborn avatar Oct 24 '22 10:10 rborn

@phynet TLDR - iOS 16 is not yet supported using maestro (view the known issues link above)

Also noting that this comment chain is starting to drift off. @matthewmturner hope idb_companion is treating you well now 🤞

alexandlazaris avatar Oct 24 '22 10:10 alexandlazaris

@rborn @alexandlazaris Oops, then is my bad. Sorry for add noise to this channel.

phynet avatar Oct 24 '22 11:10 phynet

@alexandlazaris thanks for the details. using the minimal test i still have the same issue. i use the following:

  • maestro v1.10.1
  • iOS Simulator Running iPhone 12 Pro on iOS 14.4
  • XCode 13.2.1
  • App under test was iMessage (using same test file you provided)

matthewmturner avatar Oct 24 '22 19:10 matthewmturner

I have also a crash on iOS when I try to launch a test with maestro. It works on Android

My config

  • Macbook Pro MacOS Monterey 12.5.1 with M1 Pro chip
  • maestro v1.11.3
  • iOS Simulator Running iPhone 13 on iOS 15.5
  • XCode 13.4.1

What I did

  • in a terminal launched idb_companion --udid UDID_OF_MY_PHONE
  • in another terminal window launched maestro test ios-flow.yaml
  • maestro is able to launch the app through my simulator, I can see the splashscreen
  • the app crashes just after the splashscreen and I see a weird message in my terminal, the idb_companion stop running
2022-11-01 19:34:37.864+0100 Signalled: SIGTERM
2022-11-01 19:34:37.864+0100 Successfully removed temporal directory: file:///var/folders/q_/jsxfktlj52j6v5s6l5mj1y240000gn/T/IDB/61B7050A-FE8E-4CA1-BB85-E25F6330337E
2022-11-01 19:34:37.947+0100 Responding to termination of idb with signo 15

In the simulator I see this error message Simulator Screen Shot - iPhone 13 - 2022-11-01 at 19 34 52

alexCoding42 avatar Nov 01 '22 18:11 alexCoding42

@alexCoding42 this message shows usually when you you don't have metro started

rborn avatar Nov 02 '22 08:11 rborn

@rborn yes now when I start the metro bundler I don't see this error, but I still face a crash of idb companion when trying to run maestro test ios-flow.yaml Right after the launchApp step idb companion stops running and my test fails

Capture d’écran 2022-11-02 à 13 40 50

Capture d’écran 2022-11-02 à 13 41 09

alexCoding42 avatar Nov 02 '22 12:11 alexCoding42

It seems there is an ongoing issue that is being investigated for iOS. I just spoke with some people on the Slack channel, so I guess we just have to wait :)

https://mobile-dev-inc.slack.com/archives/C041FU72T54/p1666866408069079

alexCoding42 avatar Nov 02 '22 13:11 alexCoding42

I had to upgrade my Xcode to 14 to resolve the issue that i originally reported.

matthewmturner avatar Nov 03 '22 18:11 matthewmturner

@alexCoding42 - were you able to make any progress on that issue? I'm facing the same thing

TomasBarry avatar Nov 08 '22 13:11 TomasBarry

@TomasBarry I reached the support on the Slack channel of mobile-dev there is an ongoing conversation about it: https://mobile-dev-inc.slack.com/archives/C041FU72T54/p1667904287117889?thread_ts=1666866408.069079&cid=C041FU72T54

When I installed the head version of maestro then uninstalled it and reinstalled maestro latest stable release I was able to run my tests on iOS, weird but it seems to work now.

They are doing some fixes that should be release soon

alexCoding42 avatar Nov 08 '22 14:11 alexCoding42

I have also a crash on iOS when I try to launch a test with maestro. It works on Android

My config

  • Macbook Pro MacOS Monterey 12.5.1 with M1 Pro chip
  • maestro v1.11.3
  • iOS Simulator Running iPhone 13 on iOS 15.5
  • XCode 13.4.1

What I did

  • in a terminal launched idb_companion --udid UDID_OF_MY_PHONE
  • in another terminal window launched maestro test ios-flow.yaml
  • maestro is able to launch the app through my simulator, I can see the splashscreen
  • the app crashes just after the splashscreen and I see a weird message in my terminal, the idb_companion stop running
2022-11-01 19:34:37.864+0100 Signalled: SIGTERM
2022-11-01 19:34:37.864+0100 Successfully removed temporal directory: file:///var/folders/q_/jsxfktlj52j6v5s6l5mj1y240000gn/T/IDB/61B7050A-FE8E-4CA1-BB85-E25F6330337E
2022-11-01 19:34:37.947+0100 Responding to termination of idb with signo 15

In the simulator I see this error message Simulator Screen Shot - iPhone 13 - 2022-11-01 at 19 34 52

Please Use npx react-native start on ur project

VinayR2022 avatar May 29 '24 08:05 VinayR2022

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!

github-actions[bot] avatar Jul 11 '24 10:07 github-actions[bot]