Problem: when trying to use the Java Client or the appium console, the iOS simulator and instruments crashes.
Specifics: this happens when, on a particular PageView, the client tries to find and select an element in the upper-right corner.
This occurs in two areas (after narrowing things down this is where they seem to occur):
Used appium console to do a “page class: :UIAButton” to see what buttons are availble. This causes instruments to crash. The logs give vague reports such as:
SpringBoard[11267]: HW kbd: Failed to set (null) as keyboard focus
and:
(UIKitApplication:my.app[0xee9][11332]): Service exited due to signal: Segmentation fault: 11
Used the Java client to run through automated tests. Once it gets to the screen where we want to select an element in the upper-right corner by using the name strategy, it crashes during the call to Appium to get the element (getElementBy)
An instruments log revealed that there is a dynamic library trying to be loaded in and fails, which could be a source of the issue. All answers to that problem, however, have been tried or don’t apply to our situation (i.e. creating a fresh build - which we do each time - while Appium is not running). Here’s the log snippet:
Dyld Error Message:
could not load inserted library ‘/Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-instruments/thirdparty/iwd7/InstrumentsShim.dylib’ because no suitable image found. Did find:
/Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-instruments/thirdparty/iwd7/InstrumentsShim.dylib: mmap() error 1 at address=0x104A80000, size=0x00001000 segment=__TEXT in Segment::map() mapping /Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-instruments/thirdparty/iwd7/InstrumentsShim.dylib
Conclusion:
We have the UI Automation enabled on the phone device, as well as a fresh build setup so those issues are ruled out. The issue is the Appium framework trying to access an icon by searching the app view which somehow causes a crash when done after a series of other actions.