In Calabash you can implement a backdoor, i.e., a way to call a method in the app delegate during test case execution. This makes it possible to simulate non-UI/external events like a Bluetooth device to appear/disappear, etc. in simulator.
(I understand the backdoor concept is possible because Calabash-server is linked into the executable. Appium executes tests on the an untouched executable.)
Is a similar concept available in Appium? If not what are the alternatives then?
(I couldn't find anything in the Appium documentation.)
We support this in a framework called Illuminator (full disclosure, I am the author), with an RPC channel called the automation bridge.
When instruments runs, we use the
performTaskWithPathArgumentsTimeout
function to call our script, which relays our supplied arguments to the running app (on simulator or on hardware). Any data returned from the app is relayed back to UIAutomation.