When upgraded into Appium 1.7.1, everytime app started by Appium in Simulator , I need to wait 2~6 mins to let test run. After check the Appium log, I found Appium paused at:
[debug] [JSONWP Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"desiredCapabilities":{"bundleId":"com.***.****","arguments":[],"environment":{},"shouldWaitForQuiescence":true,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true}}
after 6 mins, Appium get the following, and start to run
[debug] [JSONWP Proxy] Got response with status 200: {"value":{"sessionId":"396FCBB1-11DE-4C6D-8A07-751C97CEB2DC","capabilities":{"device":"iphone","browserName":null,"sdkVersion":"11.1","CFBundleIdentifier":null}},"sessionId":"396FCBB1-11DE-4C6D-8A07-751C97CEB2DC","status":0}
Currently, after app launched, I always need to wait 2~6 mins to let Appium responded, and start to run my test...
Appium 1.6.5 can run it without any issue. I think it should be introduced by 1.7.0 and after.
https://github.com/appium/appium/issues/9482 has the same issue, although the issue has been closed, she reproduced it again recently, cannot find a solution.
Great thanks!!
https://gist.github.com/shane51/7fe7e0d5362647ee51d7eaa591cf36bc
https://gist.github.com/shane51/140a4f9556ecb5b9169354c348feed35
private void iOSCaps() {
String IOS_APP_PATH = "/src/main/resources/*** - QA.app";
File app = new File(System.getProperty("user.dir") + IOS_APP_PATH);
capabilities = new DesiredCapabilities();
capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, MobilePlatform.IOS);
capabilities.setCapability(MobileCapabilityType.FULL_RESET, true);
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, devicesUtils.IOS_DEVICE_NAME);
capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, devicesUtils.SIMULATOR_VERSION);
capabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME, "XCUITest");
capabilities.setCapability(MobileCapabilityType.UDID, devicesUtils.SIMULATOR_UUID);
capabilities.setCapability(MobileCapabilityType.APP, app.getAbsolutePath());
capabilities.setCapability("bundleId", "com.***.qa2");
capabilities.setCapability("useNewWDA", true);
//you are free to set additional capabilities
}
Try to remove useNewWDA, bundleId, MobileCapabilityType.UDID and MobileCapabilityType.FULL_RESET capabilities
I did a some research, and finally followed https://github.com/appium/appium/issues/9482 instruction from @imurchie as below:

After remove the above. the app cannot launch now..
https://gist.github.com/shane51/c0a2228565de2f7d02c621a9a92e4967
After I manually reset simulator, the app launched, but I still need to wait 5 mins to let test run, could you please advice is there a way to avoid it? or this is current XCUITest issue?
Great Thanks @mykola-mokhnach
# Appium logs:
https://gist.github.com/shane51/8ca25b2bf99484b72ba85df945bb6feb
https://gist.github.com/shane51/781a6aeffa3de50e19de9b21edef1572
private void iOSCaps() {
String IOS_APP_PATH = "/src/main/resources/**** - QA.app";
File app = new File(System.getProperty("user.dir") + IOS_APP_PATH);
capabilities = new DesiredCapabilities();
capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, MobilePlatform.IOS);
// capabilities.setCapability(MobileCapabilityType.FULL_RESET, true);
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, devicesUtils.IOS_DEVICE_NAME);
capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, devicesUtils.SIMULATOR_VERSION);
capabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME, "XCUITest");
// capabilities.setCapability(MobileCapabilityType.UDID, devicesUtils.SIMULATOR_UUID);
capabilities.setCapability(MobileCapabilityType.APP, app.getAbsolutePath());
// capabilities.setCapability("bundleId", "com.****.qa2");
// capabilities.setCapability("useNewWDA", true);
//you are free to set additional capabilities
}

From the log, it shows XCUITest cost 5 mins to create and start wdaSession
Hi @mykola-mokhnach when I monitored the test in CI, I found it stucked at the POST request mentioned above randomly, sometimes, it starts to run test while App launched, but sometimes it still wait 5~6 mins to let POST request get the response...then start to run test.
It's really annoying for continuously running the automation tests, every 2 or 3 cases, it stucks 5 mins...
To me it looks like either like XCTest or application under test issue. Appium just waits for WebDriverAgent to respond and WDA itself waits for the app to say that accessibility is ready.
@mykola-mokhnach The app under test works fine with Appium 1.6.x for half a year.
This waiting issue came out after I upgrade Appium 1.6.5 to 1.7.0. When I downgrade to 1.6.5, it works fine. So it should related some changes in 1.7.0
Did you manage to fix the problem?
Not yet.... I'm consider using WebdriverAgent itself to see if the issue still persist...
Ok. Let me know if you find the fix.
When I downgraded to XCode 8.3.3 issue disappeared without magical capabilities. Just FYI as a workaround.
We are experiencing the same issue (Appium v1.7.1, Xcode v9.1, Mac High Sierra OS).
Downgrading Xcode version is not an option for us since some things work only with the Xcode 9 (such as the latest version of homebrew or some pods).
Any idea how to fix?
@mykola-mokhnach Can somebody look into this?
The issue magicly disappeared for me after adding
clearSystemFiles: true,
wdaStartupRetryInterval: 1000,
useNewWDA: true,
waitForQuiescence: false,
shouldUseSingletonTestManager: false
caps for Ruby. I didn't play around about what is optional, just a sum up after lurking through this and similar issues on internet.
Issue is resolved with resolution from @alexttransisland
Thanks
For me "waitForQuiescence: false" starts test before the app has started.
I have the same issue as @deedora. Anyone knows how to solve the problem without settings 'waitForQuiescence' and 'useNewWDA' capabilities?
Why can't you make a waiter until your app is launched?
something like
before do
response = Curl.get('http://localhost:8100/status') # not sure here what exact URL should be here, but something that waits for app initalization
wait(300).until { Curl.get('http://localhost:8100/status').body_str }.eq('OK')
end
I mean you can programmatically check whatever Appium returns. (appium DOM, transport layer connection etc.)
I have same problem, I tried to set the caps the same as @alexttransisland suggested. It worked for one time and when I tried to run the same case again, the problem is happening again.
We had test cases running all good for half a year with Xcode 8.3 and Appium 1.6.5 now we have to upgrade to Xcode 9 which means we have to use Appium 1.7+ then the problem emerges.
And this is observed using different clients like node.js and Python
Got the same problem here. Using Java as a base technology, but virtually always takes long
Same problem here =/ Does anyone figured out how to solve it?
@alexttransisland's solution worked for me. Thanks a lot dude, I was struggling trying to fix this has been a while. 馃槄
Hey @igorrfc, with @alexttransisland 's solution, do your cases always run? For my case sometimes it runs smoothly but sometimes it still stuck.
Hey @quintuschen, after add the suggested configs I have stable tests. Actually, I'm integrating the appium on my project, so I don't have many test cases. After you asked me this, I tried to add more tests, and the suite still running well. Would you like to know my environment specs or something like that? Just let me know :)
Hey @igorrfc If you could share some of your environment specs that would be awesome. My test cases are running well on Appium 1.6.5 and Xcode 8.3 but now it is very unstable. On Android it runs fine but iOS it often stuck at this stage.
Any official solution to this issue? I need to be able to automate iOS 11.x the same way I am able to automate 10.3.3, and it just does not work. If I have noReset = true, all testing is fine, but I cannot uninstall and reinstall the app because the Profile is no longer trusted within General > Profiles on the device. Why is this?
Hi @auto-mator This should actually be a new ticket since it is a separate issue
If I am not mistaken as long as one app with the profile (trusted) is kept on the device it will work. As soon as the last app is uninstalled then one needs to re-trust the profile.
Coming to think of it, how would this be solved on a simulator? Is trusting necessary?
That's a good point...that may work as a work-around. But why doesn't this work on iOS 11 in general, but is fine for iOS 10? I have no issues with maintaining trust when no reset is false on iOS 10
Sure enough, your idea worked perfectly Bayerjan! Thank you
Unfortunately, I have exactly the same problem working with newer versions that all those presented at the problem description of this issue. I work with Xcode 9.2 and I have checked that happens with these Appium versions: 1.7.0, 1.7.1, 1.7.2 and 1.8.0-beta.
This is an extract of my Appium logs. Once the app has been installed into a simulator/device, next logs are recurrent and it is impossible to run my own test cases:
...
[debug] [XCUITest] Sending createSession command to WDA
[debug] [JSONWP Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"desiredCapabilities":{"bundleId":"com.xxx.yyy","arguments":[],"environment":{},"shouldWaitForQuiescence":false,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":false}}
[debug] [JSONWP Proxy] Got response with status 200: {"value":"Failed to launch com.accenture.carrefour-cuali application","sessionId":"49A826C6-A2D8-42FF-9347-9F1FF994BF7B","status":13}
[debug] [XCUITest] Failed to create WDA session. Retrying...
[debug] [BaseDriver] Event 'wdaSessionAttempted' logged at 1522924456876 (12:34:16 GMT+0200 (CEST))
[debug] [XCUITest] Sending createSession command to WDA
[debug] [JSONWP Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"desiredCapabilities":{"bundleId":"com.xxx.yyy","arguments":[],"environment":{},"shouldWaitForQuiescence":false,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":false}}
[HTTP] <-- POST /wd/hub/session - - ms - -
[HTTP]
[debug] [JSONWP Proxy] Got response with status 200: {"value":"Failed to launch com.xxx.yyy application","sessionId":"49A826C6-A2D8-42FF-9347-9F1FF994BF7B","status":13}
[debug] [XCUITest] Failed to create WDA session. Retrying...
[debug] [BaseDriver] Event 'wdaSessionAttempted' logged at 1522924639155 (12:37:19 GMT+0200 (CEST))
[debug] [XCUITest] Sending createSession command to WDA
[debug] [JSONWP Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"desiredCapabilities":{"bundleId":"com.xxx.yyy","arguments":[],"environment":{},"shouldWaitForQuiescence":false,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":false}}
...
These are all capabilities I have configured, according to previous comments:
capabilities.setCapability("deviceName", "iPhone 6");
capabilities.setCapability("platformName","iOS");
capabilities.setCapability("platformVersion", "11.2");
capabilities.setCapability("automationName", "XCUITest");
capabilities.setCapability("clearSystemFiles", true);
capabilities.setCapability("wdaStartupRetryInterval", 1000);
capabilities.setCapability("useNewWDA", true);
capabilities.setCapability("waitForQuiescence", false);
capabilities.setCapability("shouldUseSingletonTestManager", false);
capabilities.setCapability("showXcodeLog", true);
capabilities.setCapability("app", binaryFile.getAbsolutePath());
I can't come back to previous versions of Appium because I need Xcode 9 for my project. I don't find the solution to the problem. Could someone help me, please?
Thanks in advance.
@jesushebra, we have been battling this issue for quite a while but we do not find the root cause. However, this might be a workaround that you could give a try. The cases won't run on my old Mac until I upgraded to a more powerful, better CPU and most importantly an SSD. Then with same settings and the same suite, they run smoothly, which makes me suspect the original problem is due to the hard disk was actually too slow to initiate the tests and it is too slow for WDA to launch. Just my guess I have no proof of that though.
@quintuschen, thank you very much for your answer. I use a MacBook Pro with next properties:
SO: macOS High Sierra v10.13.3
Id: MacBookPro14,1
Processor: 2,3 GHz Intel Core i5
Memory: 8 GB 2133 MHz LPDDR3
Graphics: Intel Iris Plus Graphics 640 1536 MB
Do you think it's normal I have problems with this computer? I purchased it last month.
Thanks again
@jesushebra Does it come with SSD? New computer should be fast though. Anyway that was only my theory. My problem was 'solved' by changing to a new Mac.
I don't think that is the only solution. My problem disappeared after I've removed every possible trace of appium from my mac and updated to 1.7.2. Also, try to remove the app you are testing, rebuild it and then install it.
@quintuschen, yes, it comes with SSD (Apple SDD SM0128L). In fact, it is a powerful Mac. However, your solution does not work for me.
@deedora, what do you mean by "I've removed every possible trace of appium from my mac"? I have uninstalled Appium and installed again (v1.7.2). I've also removed the app. However, the problem continues
Search for appium in the finder. There is probably some files or folders left after you uninstall the app.
@deedora, I've uninstalled appium, I've deleted all files and folders and I've installed appium again. However, the problem persists (even if I rebuild the app). The situation starts to be frustrating
useNewWDA: true
clearSystemFiles: true
It works for me.
Did anyone find a solution to this problem? I have a brand new macbook pro, latest appium desktop and appium, have set the suggested caps, but I still hang exactly where everyone else does.
...
{},"shouldWaitForQuiescence":false,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":false}}
Even I'm facing this issue. Any updates on this one?
Appium 1.8
xcode 9.4
capabilities.setCapability("waitForQuiescence", false)
capabilities.setCapability("useNewWDA", true)
capabilities.setCapability("shouldUseSingletonTestManager", false)
capabilities.setCapability("clearSystemFiles", true)
capabilities.setCapability("shouldUseTestManagerForVisibilityDetection", true)
still have the issue...
It's weird, it opens and closes the app 3 times and then just hangs...
@jpita I am also facing the same issue. it opens and closes the app 3 times and then just hangs. DId you find any workaround ?
@NiveditaSachan no, I quit on automating on iOS for now.
If I have time I'll get back to it, if I keep on having issues I'll try to automate with the native framework, XCUItest
@jpita Thanks for responding. It worked for me when I used Simulator build to inspect elements of my native iOS app.
thank you so much guys, i have managed to fix the issue using solution proposed by @alexttransisland. making some good progress
In case anyone is still having the same problem, try upgrading everything (NPM, Appium, etc); I know it sounds obvious, but what's probably happened is that you've installed an OS upgrade that's not compatible with some component of the Appium/WebDriver setup. For me, the problem was carthage (brew update carthage) - an easy one to overlook. Hope this helps.
I have this very same issue, as I reported it back again on this ticket: https://github.com/appium/appium/issues/11864
@jpita I am also facing the same issue. it opens and closes the app 3 times and then just hangs. DId you find any workaround ?
hello, have you resolved this problem?
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
The issue magicly disappeared for me after adding
caps for Ruby. I didn't play around about what is optional, just a sum up after lurking through this and similar issues on internet.