[v1.32.0] `launchApp` command affecting iOS simulator's ability to retrieve current location
I've been experiencing an issue with the launchApp command in Maestro UI Tests tool, which leads to a malfunction in the iOS simulator's ability to obtain its current location.
Steps to reproduce:
- Manually set a custom location in the iOS Simulator using the path: iOS Simulator > Features > Location > Custom location.
- Launch an app, like Apple Maps, and verify the correct location is shown.
- Use the Maestro flow with the following commands:
- launchApp:
clearState: false
clearKeychain: false
permissions:
location: inuse
usertracking: allow
notifications: allow
- Launch the same app (or another one) and observe that the simulator fails to retrieve the current location.
Additional observations:
- When attempting the same with Apple Maps using the flow:
appId: com.apple.Maps
---
- launchApp:
clearState: false
clearKeychain: false
- tapOn:
id: "UserLocationButton"
I received a location error (screenshot attached: Simulator Screenshot - iPhone 14 Pro - 2023-09-14 at 12.53.53.png).
I tried both manually setting the location and using the setLocation command from Maestro (setLocation reference), but the issue persisted.
It seems that there might be an underlying issue with how the launchApp command or possibly the idb-companion interacts with the simulator's location services.
Expected behavior
launchApp command not interfering with the ability to retrieve current location in the iOS simulator and, in consequence, be able to set different locations while running tests.
Environment information (please complete the following information):
- Maestro version: v1.32.0 (⚠️ but I faced this issue in other Maestro versions)
- Platform: iOS 16.4 and iOS 17
- Framework: Native iOS
- Device model and OS version: iPhone 14 Pro with iOS 16.4 or iOS 17
- Simulator
- Host: MacBook Pro M1 with macOS Ventura 13.5.1 (22G90)
Bugreport output
Attachments
- Screen Recording: https://github.com/mobile-dev-inc/maestro/assets/3541185/7658ec1e-1fb9-4146-81a2-df6cecb6e2df
Thank you for looking into this ❤️
I have a similar problem in my react native app. I use IOS simulator with maestro.
Inside the app i use @react-native-community/geolocation to retrive user location with getCurrentPosition method.
It always returns me an error saying "Unable to retrieve location.".
I have checked that user granted permission before asking for location.
Also tried setting the location using setLocation, and this doesn't seem to work properly
I have the same issue with the Flutter application. When I tried to run the app I could give the permission but could not retrieve any location data.
Maestro Cli 1.33.1 Xcode 15 iOS 16.4
Same issue here, any solution?
+1 Still having this issue on my react native app - any solutions?
No 😞 I'm still having trouble setting different locations while running Maestro.