Does your app ask to be allowed to access the device location before it freezes, or does the app present any sort of pop-up at startup?
I did some more troubleshooting and I made a simple app with a simple test to see if I can get Appium running. The simple app and test ran fine, so I think the issue might either be with the app, Xcode and Instruments, or iOS 8.
Ah, that’s interesting. Our app presents a couple of pop-ups before freezing which we dismiss with taps. We make 2 other taps after tapping the pop-ups, which causes the app to hang.
Right now, we’re glad that we’re not the only ones with the problem.
@awang, I finally have a workaround for this issue, it turned out the app got frozen because the dev guy logged all the received json data. and somehow the app ran to racing condition with that logging. If I turn the log off then everything is ok.
I guess probably your app has faced the same issue too, here are steps that I made to figured it out:
Run the app until it get frozen, then open activity monitor to print the sample of the app process.
You can find the waiting thread in there, and track back to the code which called to that.
Try to disable that called function and try with the app again to see if it solves the problem.
Although I can have a workaround here but there are still 3 questions that I cannot answer:
Why the app run well with xcode?
Why the app run well with command line ( exactly the same command line as Appium)?
I just tested out what you said with a sample app by adding in a big log line. Amazingly, the app did freeze after adding in the giant log statement. We created a build of our actual app with the logging commented out, and we are very relieved to see automation running on it without the app freezing.
Thank you for your excellent analysis, @tbao! Definitely glad to have learned something new from you!
This is not all about 3-4 taps. We observed Appium(1.3.1) itself freezes after some hours of script run. So to stop/restart appium we had to force quit it (As Stop button goes unresponsive ). In last 3-4 attempts a complete test suite which was taking around 7 hours with iOS 6, now it is getting freeze just after 30-40% of tests run. Also 30-40% tests of the test suite is now consuming around 9 hours.
I tried that out with the sample application, and it seems that Appium gets slower and slower as it sends commands. I added in a counter to my test script, and it seems that Appium can send several hundred taps before its performance comes to a crawl. I would recommend posting this as a separate issue.
I still have the same issue that freeze my app at the beginning or after 2-3 clicks.
Appium 1.3.5
Robot Framework 2.8.6 (Python 2.7.6 on darwin)
IOS 8.1
@tbao, thanks for you comments. They are clear and handy. Could you give me some clues how to recognise which process is blocking my app? I’m analyzing my app process sample and looking some info in Call Graph section.
I’m having same issue with my 8.1 iOS sim. It’s very probably thats issue is also caused by loging json data
@stefan, I don’t think there is a general way to recognize if a thread is blocking, but this is what I did when looking into the Call Graph:
Track down each thread to the very bottom of the called tree. At the bottom is the function / method of “current” stage of the thread when the sample of the entire process is created.
If there is some function / method related to “wait” then it is possibly the cause of deadlock
Track up from that function / method until you can find where your code actually call it, and disable that call and retry again.
While automating our app, strangely few pages failed to load as the loader kept on running without displaying anything on page. @tbao Thanks to this post I was finally able to run my code on IOS8.
It was happening due to API NSlogs being printed. So I just commented the line out & app started working fine.