facebookarchive / WebDriverAgent

A WebDriver server for iOS that runs inside the Simulator.
Other
4.15k stars 1.38k forks source link

Xcode 10.1, Appium 1.9.1 Webdriver Agent hangs indefinitely when calling terminate_app #1028

Open Jiurong-Yang opened 6 years ago

Jiurong-Yang commented 6 years ago

Ever since I switch to xcode 10 to be compatible with IOS 12 devices my scripts stopped working. Basically for our app we need to install the app change the settings in ios settings and then relaunch the app. It was working fine before. But now when I go to terminate the main app I launched Appium with the appium server hangs. Probably due to the fact that WDA is hanging. Hopefully someone can look into this.

Reference to the appium issue: https://github.com/appium/appium/issues/11652

I'll try to revert back to xcode 9 and see if that fixes the issue.

fr0l commented 6 years ago

I observe similar behaviour. Not yet sure when it starts to do guru meditation. I see in logs in cycle following messages (not sure whichever is first):

App state updated for <XCUIApplicationImpl: 0x600001588300 com.badoo.Badoo.dev>: Unknown (0)
testmanagerd reported update to com.badoo.Badoo.dev, pid: 75770, BKSApplicationState: 0
Starting to monitor <XCUIApplicationImpl: 0x600001588300 com.badoo.Badoo.dev>
Done setting pid for <XCUIApplicationImpl: 0x600001588300 com.badoo.Badoo.dev> to 75770

but no all the time. and started after moving to iOS 12.1

Jiurong-Yang commented 6 years ago

I don't think it's IOS dependant I think It's more xcode dependant since after i upgraded my system Appium 1.9 - 1.9.1 Xcode 9.4.3 - 10.1 All of the IOS phones have this behaviour. I tried it on an IOS 12.1 12.0 and 11 and they all exhibit the same symptom.

trinhphat00101 commented 5 years ago

I also have the same issue. When using xcode lower than 10. Everything work ok. But when i update to Xcode 10.1. All the device is hang when running WDA, from real device IOS 10.1 to stimulator

hangyumao commented 5 years ago

I observe similar behaviour. Not yet sure when it starts to do guru meditation. I see in logs in cycle following messages (not sure whichever is first):

App state updated for <XCUIApplicationImpl: 0x600001588300 com.badoo.Badoo.dev>: Unknown (0)
testmanagerd reported update to com.badoo.Badoo.dev, pid: 75770, BKSApplicationState: 0
Starting to monitor <XCUIApplicationImpl: 0x600001588300 com.badoo.Badoo.dev>
Done setting pid for <XCUIApplicationImpl: 0x600001588300 com.badoo.Badoo.dev> to 75770

but no all the time. and started after moving to iOS 12.1

have you sloved this problem?

Jiurong-Yang commented 5 years ago

I have not found a solution. And it doesn't seem like there is any support form the open source community for this.

mykola-mokhnach commented 5 years ago

It's just the problem itself is very complicated, so there is no easy solution to it. Feel free to check on the thread in https://github.com/appium/WebDriverAgent/pull/134 if you are ObjectiveC developer

Jiurong-Yang commented 5 years ago

Yeah I guess for me technically there is a solution. My obstacle is that I need to restart the app after making changes in the IOS settings. I can accomplish this through two driver sessions. First driver session to install the App and launch the App switch to settings make the changes and terminate the session. Start a second session without full reset and it'll close the app if it was already open and then re launch the app which will apply the settings change. I guess this is the only work around right now on the client side.

One major downside to this work around is if the tests are being run in parallel with a device management system like selenium grid then you have to make sure after you terminate the first session your second session will run on the exact same device. This either requires client side restriction on grid functionalities or instead of using grid you'll just have to develop a device management system that suits your needs.

Unfortunately I'm not an objective C developer. But it's comforting to know that the open source community is working on a solution.