Cannot interact with second app via Appium (multi app scenario)

Hello,

I have the following setup where I have 2 appium servers running on my OS X and I create 2 drivers (one for each app). I start app B first and then I start app A and this results in app B getting backgrounded.
Code to set up the app is

	public void setup() throws MalformedURLException
{
	DesiredCapabilities cap = this.initializeApplication("appB.app");
    this.authenticatorDriver = new IOSDriver(new URL("http://127.0.0.1:4724/wd/hub"), cap);
    this.authenticatorApp = new Authenticator(this.authenticatorDriver);
    
    cap = this.initializeApplication("appA.app");
    this.clientDriver = new IOSDriver(new URL("http://127.0.0.1:4723/wd/hub"), cap);
	

    this.clientApp = new ClientApplication(this.clientDriver);
}

public DesiredCapabilities initializeApplication(String applicationPath) throws MalformedURLException
{
    DesiredCapabilities capabilities = new DesiredCapabilities();
    capabilities.setCapability(MobileCapabilityType.BROWSER_NAME, "");
    capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, "8.3");
    capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "iPhone Simulator");
    capabilities.setCapability(MobileCapabilityType.APP, applicationPath);
    
    return capabilities;
}

public void testEndtoEnd() throws MalformedURLException
{
	clientApp.clickEndToEnd();
	authenticatorApp.addUser();
}

I am able to interact with app A controls that invokes app B, but when I try to interact with app B, appium times out with the error that the element was not found. Is there any workaround to this or any special method that sets the app to foreground or something?

additional logs from the problem app.

appium --port 4724 --no-reset --device-name "iPhone 6" --plaorm-name iOS --platform-version "8.3" --browser-name iOS
warn: Appium support for versions of node < 0.12 has been deprecated and will be removed in a future version. Please upgrade!
info: Welcome to Appium v1.4.7 (REV 3b1a3b3ddffa1b74ce39015a7a6d46a55028e32c)
info: Appium REST http interface listener started on 0.0.0.0:4724
info: [debug] Non-default server args: {"port":4724,"noReset":true,"deviceName":"iPhone 6","platformName":"iOS","platformVersion":"8.3","browserName":"iOS"}
info: Console LogLevel: debug
info: --> POST /wd/hub/session {"desiredCapabilities":{"app":"/Users/<username>/Library/Developer/Xcode/DerivedData/ADAB-bvcelnfdafckoahgsnmzojpxkneo/Build/Products/Debug-iphonesimulator/MyApp.app","platformVersion":"8.3","deviceName":"iPhone Simulator","platformName":"iOS","browserName":""}}
info: Client User-Agent string: Apache-HttpClient/4.3.3 (java 1.5)
info: [debug] Using local app from desired caps: /Users/<username>/Library/Developer/Xcode/DerivedData/ADAB-bvcelnfdafckoahgsnmzojpxkneo/Build/Products/Debug-iphonesimulator/MyApp.app
info: [debug] Creating new appium session 9b88836c-8e6b-4f5b-b450-705cb558d097
info: [debug] Removing any remaining instruments sockets
info: [debug] Cleaned up instruments socket /tmp/instruments_sock
info: [debug] Setting Xcode version
info: [debug] Xcode version set to 6.3.2
info: [debug] Setting iOS SDK Version
info: [debug] iOS SDK Version set to 8.3
info: [debug] Checking whether instruments supports our device string
info: [debug] Getting list of devices instruments supports
info: [debug] Instruments is at: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments
info: [debug] Getting device string from opts: {"forceIphone":false,"forceIpad":false,"xcodeVersion":"6.3.2","iOSSDKVersion":"8.3","deviceName":"iPhone Simulator","platformVersion":"8.3"}
info: [debug] fixDevice is on
info: [debug] Fixing device. Changed from: "iPhone Simulator (8.3 Simulator)" to: "iPhone 6 (8.3 Simulator)"
info: [debug] Final device string is: 'iPhone 6 (8.3 Simulator)'
info: [debug] iOS sim UDID is 7689DE02-FD7C-4D3C-B89B-8792DF5B7AB8
info: [debug] Auto-detecting iOS udid...
info: [debug] Not auto-detecting udid, running on sim
info: [debug] Could not parse plist file (as binary) at /Users/<username>/Library/Developer/Xcode/DerivedData/ADAB-bvcelnfdafckoahgsnmzojpxkneo/Build/Products/Debug-iphonesimulator/MyApp.app/en.lproj/Localizable.strings
info: Will try to parse the plist file as XML
info: [debug] Could not parse plist file (as XML) at /Users/<username>/Library/Developer/Xcode/DerivedData/ADAB-bvcelnfdafckoahgsnmzojpxkneo/Build/Products/Debug-iphonesimulator/MyApp.app/en.lproj/Localizable.strings
warn: Could not parse app Localizable.strings assuming it doesn't exist
info: [debug] Getting bundle ID from app
info: [debug] Parsed app Info.plist (as binary)
info: [debug] Creating instruments
info: [debug] Preparing uiauto bootstrap
info: [debug] Dynamic bootstrap dir: /Users/<username>/Library/Application Support/appium/bootstrap
info: [debug] Dynamic env: {"nodePath":"/usr/local/bin/node","commandProxyClientPath":"/usr/local/lib/node_modules/appium/node_modules/appium-uiauto/bin/command-proxy-client.js","instrumentsSock":"/tmp/instruments_sock","interKeyDelay":null,"justLoopInfinitely":false,"autoAcceptAlerts":false,"autoDismissAlerts":false,"sendKeyStrategy":"oneByOne"}
info: [debug] Dynamic bootstrap code: // This file is automatically generated. Do not manually...dify!
info: [debug] Dynamic bootstrap path: /Users/<username>/Library/Application Support/appium/bootstrap/bootstrap-467e3886869ec210.js
info: [debug] Reusing dynamic bootstrap: /Users/<username>/Library/Application Support/appium/bootstrap/bootstrap-467e3886869ec210.js
info: [debug] Getting device string from opts: {"forceIphone":false,"forceIpad":false,"xcodeVersion":"6.3.2","iOSSDKVersion":"8.3","deviceName":"iPhone Simulator","platformVersion":"8.3"}
info: [debug] fixDevice is on
info: [debug] Fixing device. Changed from: "iPhone Simulator (8.3 Simulator)" to: "iPhone 6 (8.3 Simulator)"
info: [debug] Final device string is: 'iPhone 6 (8.3 Simulator)'
info: [debug] We're on iOS7.1+ so forcing defaultDevice on
info: [debug] Getting device string from opts: {"forceIphone":false,"forceIpad":false,"xcodeVersion":"6.3.2","iOSSDKVersion":"8.3","deviceName":"iPhone Simulator","platformVersion":"8.3"}
info: [debug] fixDevice is on
info: [debug] Fixing device. Changed from: "iPhone Simulator (8.3 Simulator)" to: "iPhone 6 (8.3 Simulator)"
info: [debug] Final device string is: 'iPhone 6 (8.3 Simulator)'
info: [debug] Parsed app Info.plist (as binary)
info: [debug] Wrote new app Info.plist with device type
info: [debug] Checking whether we need to set app preferences
info: [debug] Reset not set, not ending sim or cleaning up app state
info: [debug] Not setting locale
info: [debug] No iOS / app preferences to set
info: [debug] Starting iOS 8.* simulator log capture
info: [debug] Not pre-launching simulator
info: [debug] Starting command proxy.
info: [debug] Instruments socket server started at /tmp/instruments_sock
info: [debug] Starting instruments
info: [debug] Instruments is at: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments
info: Launching instruments
info: [debug] Attempting to run app on iPhone 6 (8.3 Simulator)
info: [debug] Spawning instruments with command: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.xrplugin/Contents/Resources/Automation.tracetemplate -D /tmp/appium-instruments/instrumentscli0.trace -w "iPhone 6 (8.3 Simulator)" /Users/<username>/Library/Developer/Xcode/DerivedData/ADAB-bvcelnfdafckoahgsnmzojpxkneo/Build/Products/Debug-iphonesimulator/MyApp.app -e UIASCRIPT "/Users/<username>/Library/Application Support/appium/bootstrap/bootstrap-467e3886869ec210.js" -e UIARESULTSPATH /tmp/appium-instruments
info: [debug] And extra without-delay env: {"DYLD_INSERT_LIBRARIES":"/usr/local/lib/node_modules/appium/node_modules/appium-instruments/thirdparty/iwd6/InstrumentsShim.dylib","LIB_PATH":"/usr/local/lib/node_modules/appium/node_modules/appium-instruments/thirdparty/iwd6"}
info: [debug] And launch timeouts (in ms): {"global":90000}
info: Instruments is ready to receive commands
info: [debug] Instruments launched. Starting poll loop for new commands.
info: [debug] Setting bootstrap config keys/values
info: [debug] Pushing command to appium work queue: "target = $.target();\nau = $;\n$.isVerbose = true;\n"
info: [debug] Socket data received (2 bytes)
info: [debug] Socket data being routed.
info: [debug] Sending command to instruments: target = $.target();
au = $;
$.isVerbose = true;

info: [debug] Socket data received (27 bytes)
info: [debug] Socket data being routed.
info: [debug] Got result from instruments: {"status":0,"value":true}
info: [debug] Setting initial orientation to PORTRAIT
info: [debug] Pushing command to appium work queue: "au.setScreenOrientation('PORTRAIT')"
info: [debug] Sending command to instruments: au.setScreenOrientation('PORTRAIT')
info: [debug] [INST] 2015-07-08 07:55:09 +0000 Debug: evaluation finished
info: [debug] [INST] 2015-07-08 07:55:09 +0000 Debug: responding with:
info: [debug] [INST] 2015-07-08 07:55:09 +0000 Debug: Running system command #1: /usr/local/bin/node /usr/local/lib/node_modules/appium/node_modules/appium-uiauto/bin/command-proxy-client.js /tmp/instruments_sock 2,{"status":0,"value":true}...
info: [debug] [INST] 2015-07-08 07:55:09 +0000 Debug: Got new command 1 from instruments: au.setScreenOrientation('PORTRAIT')
info: [debug] [INST] 2015-07-08 07:55:09 +0000 Debug: evaluating au.setScreenOrientation('PORTRAIT')
info: [debug] [INST] 2015-07-08 07:55:09 +0000 Debug: target.setDeviceOrientation("1")
info: [debug] [INST] 2015-07-08 07:55:09 +0000 Debug: evaluation finished
info: [debug] [INST] 2015-07-08 07:55:09 +0000 Debug: responding with:
info: [debug] [INST] 2015-07-08 07:55:09 +0000 Debug: Running system command #2: /usr/local/bin/node /usr/local/lib/node_modules/appium/node_modules/appium-uiauto/bin/command-proxy-client.js /tmp/instruments_sock 2,{"status":0,"value":"PORTRAIT"}...
info: [debug] Socket data received (33 bytes)
info: [debug] Socket data being routed.
info: [debug] Got result from instruments: {"status":0,"value":"PORTRAIT"}
info: [debug] Waiting for app source to contain elements
info: [debug] Pushing command to appium work queue: "au.mainApp().getTreeForXML()"
info: [debug] Sending command to instruments: au.mainApp().getTreeForXML()
info: [debug] [INST] 2015-07-08 07:55:10 +0000 Debug: Got new command 2 from instruments: au.mainApp().getTreeForXML()
info: [debug] [INST] 2015-07-08 07:55:10 +0000 Debug: evaluating au.mainApp().getTreeForXML()
info: [debug] [INST] 2015-07-08 07:55:10 +0000 Debug: evaluation finished
info: [debug] [INST] 2015-07-08 07:55:10 +0000 Debug: responding with:"dom":null,"enabled":true,"valid":true,"visible":true,"hint":null,"path":"/0/0","x":0,"y":0,"width":375,"height":667},">":[]}},{"UIAWindow":{"@":{"name":null,"label":null,"value":null,"dom":null,"enabled":true,"valid":true,"visible":true,"hint":null,"path":"/0/1","x":0,"y":0.6875,"width":375,"height":665.625},">":[{"UIANavigationBar":{"@":{"name":"View","label":null,"value":null,"dom":null,"enabled":true,"valid":true,"visible":true,"hint":null,"path":"/0/1/0","x":0,"y":24.125,"width":375,"height":51.5625},">":[{"UIAImage":{"@":{"name":null,"label":null,"value":null,"dom":null,"enabled":true,"valid":true,"visible":false,"hint":null,"path":"/0/1/0/0","x":0,"y":0.6875,"width":375,"height":75},">":[{"UIAImage":{"@":{"name":null,"label":null,"value":null,"dom":null,"enabled":true,"valid":true,"visible":false,"hint":null,"path":"/0/1/0/0/0","x":0,"y":75.6875,"width":375,"height":0.5859375},">":[]}}]}},{"UIAButton":{"@":{"name":"Back","label":"Back","value":null,"dom":null,"enabled":true,"valid":true,"visible":false,"hint":null,"path":"/0/1/0/1","x":9.375,"y":37.6015625,"width":24.609375,"height":24.609375},">":[]}},{"UIAButton":{"@":{"name":"Cancel","label":"Cancel","value":null,"dom":null,"enabled":true,"valid":true,"visible":true,"hint":null,"path":"/0/1/0/2","x":18.75,"y":32.328125,"width":83.203125,"height":35.15625},">":[]}},{"UIAButton":{"@":{"name":"Settings","label":"Settings","value":null,"dom":null,"enabled":true,"valid":true,"visible":true,"hint":null,"path":"/0/1/0/3","x":273.046875,"y":32.328125,"width":83.203125,"height":35.15625},">":[]}}]}},{"UIAButton":{"@":{"name":"Add User","label":"Add User","value":null,"dom":null,"enabled":true,"valid":true,"visible":true,"hint":null,"path":"/0/1/1","x":9.375,"y":85.0625,"width":150,"height":35.15625},">":[]}},{"UIAButton":{"@":{"name":"Clear Logs","label":"Clear Logs","value":null,"dom":null,"enabled":true,"valid":true,"visible":true,"hint":null,"path":"/0/1/2","x":257.8125,"y":85.0625,"width":96.09375,"height":35.15625},">":[]}},{"UIAButton":{"@":{"name":"Reset Application State","label":"Reset Application State","value":null,"dom":null,"enabled":true,"valid":true,"visible":true,"hint":null,"path":"/0/1/3","x":9.375,"y":129.59375,"width":201.5625,"height":35.15625},">":[]}},{"UIAButton":{"@":{"name":"Email Logs","label":"Email Logs","value":null,"dom":null,"enabled":true,"valid":true,"visible":true,"hint":null,"path":"/0/1/4","x":257.8125,"y":129.59375,"width":110.15625,"height":35.15625},">":[]}},{"UIATableView":{"@":{"name":"Empty list","label":"Empty list","value":null,"dom":null,"enabled":true,"valid":true,"visible":true,"hint":null,"path":"/0/1/5","x":0,"y":233.890625,"width":375,"height":432.421875},">":[]}}]}},{"UIAWindow":{"@":{"name":null,"label":null,"value":null,"dom":null,"enabled":true,"valid":true,"visible":false,"hint":null,"path":"/0/2","x":0,"y":0.6875,"width":375,"height":665.625},">":[]}},{"UIAWindow":{"@":{"name":null,"label":null,"value":null,"dom":null,"enabled":true,"valid":true,"visible":true,"hint":null,"path":"/0/3","x":0,"y":0.6875,"width":375,"height":665.625},">":[{"UIAStatusBar":{"@":{"name":null,"label":null,"value":null,"dom":null,"enabled":true,"valid":true,"visible":true,"hint":null,"path":"/0/3/0","x":0,"y":0.6875,"width":375,"height":23.4375},">":[{"UIAElement":{"@":{"name":"Swipe down with three fingers to reveal the notification center., Swipe up with three fingers to reveal the control center, Double-tap to scroll to top","label":null,"value":null,"dom":null,"enabled":true,"valid":true,"visible":true,"hint":"Swipe down with three fingers to reveal the notification center., Swipe up with three fingers to reveal the control center, Double-tap to scroll to top","path":"/0/3/0/0","x":7.03125,"y":0.6875,"width":44.53125,"height":23.4375},">":[]}},{"UIAElement":{"@":{"name":"3 of 3 Wi-Fi bars","label":"3 of 3 Wi-Fi bars","value":null,"dom":null,"enabled":true,"valid":true,"visible":true,"hint":"Swipe down with three fingers to reveal the notification center., Swipe up with three fingers to reveal the control center, Double-tap to scroll to top","path":"/0/3/0/1","x":57.421875,"y":0.6875,"width":15.234375,"height":23.4375},">":[]}},{"UIAElement":{"@":{"name":"12:55 AM","label":"12:55 AM","value":null,"dom":null,"enabled":true,"valid":true,"visible":true,"hint":"Swipe down with three fingers to reveal the notification center., Swipe up with three fingers to reveal the control center, Double-tap to scroll to top","path":"/0/3/0/2","x":157.03125,"y":0.6875,"width":60.9375,"height":23.4375},">":[]}},{"UIAElement":{"@":{"name":"100% battery power","label":"100% battery power","value":null,"dom":null,"enabled":true,"valid":true,"visible":true,"hint":"Swipe down with three fingers to reveal the notification center., Swipe up with three fingers to reveal the control center, Double-tap to scroll to top","path":"/0/3/0/3","x":339.84375,"y":0.6875,"width":29.296875,"height":23.4375},">":[]}}]}}]}}]}}}
info: [debug] [INST] 2015-07-08 07:55:10 +0000 Debug: Running system command #3: /usr/local/bin/node /usr/local/lib/node_modules/appium/node_modules/appium-uiauto/bin/command-proxy-client.js /tmp/instruments_sock 2,{"status":0,"value":{"UIAApplication":{"@":{"name":"MyTestADBrokerApp","label":"MyTestADBrokerApp","value":null,"dom":null,"enabled":true,"valid":true,"visible":true,...
info: [debug] Socket data received (5267 bytes)
info: [debug] Socket data being routed.
info: [debug] Got result from instruments: {"status":0,"value":{"UIAApplication":{"@":{"name":"MyTestADBrokerApp","label":"MyTestADBrokerApp","value":null,"dom":null,"enabled":true,"valid":true,"visible":true,"hint":null,"path":"/0","x":0,"y":24.125,"width":375,"height":642.1875},">":[{"UIAWindow":{"@":{"name":null,"label":null,"value":null,
info: [debug] Device launched! Ready for commands
info: [debug] Setting command timeout to the default of 60 secs
info: [debug] Appium session started with sessionId 9b88836c-8e6b-4f5b-b450-705cb558d097
info: <-- POST /wd/hub/session 303 4729.274 ms - 74
info: --> GET /wd/hub/session/9b88836c-8e6b-4f5b-b450-705cb558d097 {}
info: [debug] Responding to client with success: {"status":0,"value":{"webStorageEnabled":false,"locationContextEnabled":false,"browserName":"","platform":"MAC","javascriptEnabled":true,"databaseEnabled":false,"takesScreenshot":true,"networkConnectionEnabled":false,"warnings":{},"desired":{"app":"/Users/<username>/Library/Developer/Xcode/DerivedData/ADAB-bvcelnfdafckoahgsnmzojpxkneo/Build/Products/Debug-iphonesimulator/MyApp.app","platformVersion":"8.3","deviceName":"iPhone Simulator","platformName":"iOS","browserName":""},"app":"/Users/<username>/Library/Developer/Xcode/DerivedData/ADAB-bvcelnfdafckoahgsnmzojpxkneo/Build/Products/Debug-iphonesimulator/MyApp.app","platformVersion":"8.3","deviceName":"iPhone Simulator","platformName":"iOS"},"sessionId":"9b88836c-8e6b-4f5b-b450-705cb558d097"}
info: <-- GET /wd/hub/session/9b88836c-8e6b-4f5b-b450-705cb558d097 200 2.329 ms - 806 {"status":0,"value":{"webStorageEnabled":false,"locationContextEnabled":false,"browserName":"","platform":"MAC","javascriptEnabled":true,"databaseEnabled":false,"takesScreenshot":true,"networkConnectionEnabled":false,"warnings":{},"desired":{"app":"/Users/<username>/Library/Developer/Xcode/DerivedData/ADAB-bvcelnfdafckoahgsnmzojpxkneo/Build/Products/Debug-iphonesimulator/MyApp.app","platformVersion":"8.3","deviceName":"iPhone Simulator","platformName":"iOS","browserName":""},"app":"/Users/<username>/Library/Developer/Xcode/DerivedData/ADAB-bvcelnfdafckoahgsnmzojpxkneo/Build/Products/Debug-iphonesimulator/MyApp.app","platformVersion":"8.3","deviceName":"iPhone Simulator","platformName":"iOS"},"sessionId":"9b88836c-8e6b-4f5b-b450-705cb558d097"}
info: --> POST /wd/hub/session/9b88836c-8e6b-4f5b-b450-705cb558d097/element {"using":"xpath","value":"//UIAApplication[1]/UIAWindow[2]/UIAButton[1]"}
info: [debug] Waiting up to 0ms for condition
info: [debug] Pushing command to appium work queue: "au.mainApp().getTreeForXML()"
info: [debug] Sending command to instruments: au.mainApp().getTreeForXML()
info: [debug] [INST] 2015-07-08 07:55:28 +0000 Debug: Got new command 3 from instruments: au.mainApp().getTreeForXML()
info: [debug] [INST] 2015-07-08 07:55:28 +0000 Debug: evaluating au.mainApp().getTreeForXML()
info: [debug] [INST] 2015-07-08 07:55:28 +0000 Debug: evaluation finished
info: [debug] [INST] 2015-07-08 07:55:28 +0000 Debug: responding with:"dom":null,"enabled":true,"valid":true,"visible":true,"hint":null,"path":"/0/0","x":0,"y":0,"width":375,"height":667},">":[]}},{"UIAWindow":{"@":{"name":null,"label":null,"value":null,"dom":null,"enabled":true,"valid":true,"visible":true,"hint":null,"path":"/0/1","x":0,"y":0.6875,"width":375,"height":665.625},">":[{"UIANavigationBar":{"@":{"name":"View","label":null,"value":null,"dom":null,"enabled":true,"valid":true,"visible":true,"hint":null,"path":"/0/1/0","x":0,"y":24.125,"width":375,"height":51.5625},">":[{"UIAImage":{"@":{"name":null,"label":null,"value":null,"dom":null,"enabled":true,"valid":true,"visible":false,"hint":null,"path":"/0/1/0/0","x":0,"y":0.6875,"width":375,"height":75},">":[{"UIAImage":{"@":{"name":null,"label":null,"value":null,"dom":null,"enabled":true,"valid":true,"visible":false,"hint":null,"path":"/0/1/0/0/0","x":0,"y":75.6875,"width":375,"height":0.5859375},">":[]}}]}},{"UIAButton":{"@":{"name":"Back","label":"Back","value":null,"dom":null,"enabled":true,"valid":true,"visible":false,"hint":null,"path":"/0/1/0/1","x":9.375,"y":37.6015625,"width":24.609375,"height":24.609375},">":[]}},{"UIAButton":{"@":{"name":"Cancel","label":"Cancel","value":null,"dom":null,"enabled":true,"valid":true,"visible":true,"hint":null,"path":"/0/1/0/2","x":18.75,"y":32.328125,"width":83.203125,"height":35.15625},">":[]}},{"UIAButton":{"@":{"name":"Settings","label":"Settings","value":null,"dom":null,"enabled":true,"valid":true,"visible":true,"hint":null,"path":"/0/1/0/3","x":273.046875,"y":32.328125,"width":83.203125,"height":35.15625},">":[]}}]}},{"UIAButton":{"@":{"name":"Add User","label":"Add User","value":null,"dom":null,"enabled":true,"valid":true,"visible":true,"hint":null,"path":"/0/1/1","x":9.375,"y":85.0625,"width":150,"height":35.15625},">":[]}},{"UIAButton":{"@":{"name":"Clear Logs","label":"Clear Logs","value":null,"dom":null,"enabled":true,"valid":true,"visible":true,"hint":null,"path":"/0/1/2","x":257.8125,"y":85.0625,"width":96.09375,"height":35.15625},">":[]}},{"UIAButton":{"@":{"name":"Reset Application State","label":"Reset Application State","value":null,"dom":null,"enabled":true,"valid":true,"visible":true,"hint":null,"path":"/0/1/3","x":9.375,"y":129.59375,"width":201.5625,"height":35.15625},">":[]}},{"UIAButton":{"@":{"name":"Email Logs","label":"Email Logs","value":null,"dom":null,"enabled":true,"valid":true,"visible":true,"hint":null,"path":"/0/1/4","x":257.8125,"y":129.59375,"width":110.15625,"height":35.15625},">":[]}},{"UIATableView":{"@":{"name":"Empty list","label":"Empty list","value":null,"dom":null,"enabled":true,"valid":true,"visible":true,"hint":null,"path":"/0/1/5","x":0,"y":233.890625,"width":375,"height":432.421875},">":[]}}]}},{"UIAWindow":{"@":{"name":null,"label":null,"value":null,"dom":null,"enabled":true,"valid":true,"visible":false,"hint":null,"path":"/0/2","x":0,"y":0.6875,"width":375,"height":665.625},">":[]}},{"UIAWindow":{"@":{"name":null,"label":null,"value":null,"dom":null,"enabled":true,"valid":true,"visible":true,"hint":null,"path":"/0/3","x":0,"y":0.6875,"width":375,"height":665.625},">":[{"UIAStatusBar":{"@":{"name":null,"label":null,"value":null,"dom":null,"enabled":true,"valid":true,"visible":true,"hint":null,"path":"/0/3/0","x":0,"y":0.6875,"width":375,"height":23.4375},">":[{"UIAElement":{"@":{"name":"Swipe down with three fingers to reveal the notification center., Swipe up with three fingers to reveal the control center, Double-tap to scroll to top","label":null,"value":null,"dom":null,"enabled":true,"valid":true,"visible":true,"hint":"Swipe down with three fingers to reveal the notification center., Swipe up with three fingers to reveal the control center, Double-tap to scroll to top","path":"/0/3/0/0","x":7.03125,"y":0.6875,"width":44.53125,"height":23.4375},">":[]}},{"UIAElement":{"@":{"name":"3 of 3 Wi-Fi bars","label":"3 of 3 Wi-Fi bars","value":null,"dom":null,"enabled":true,"valid":true,"visible":true,"hint":"Swipe down with three fingers to reveal the notification center., Swipe up with three fingers to reveal the control center, Double-tap to scroll to top","path":"/0/3/0/1","x":57.421875,"y":0.6875,"width":15.234375,"height":23.4375},">":[]}},{"UIAElement":{"@":{"name":"12:55 AM","label":"12:55 AM","value":null,"dom":null,"enabled":true,"valid":true,"visible":true,"hint":"Swipe down with three fingers to reveal the notification center., Swipe up with three fingers to reveal the control center, Double-tap to scroll to top","path":"/0/3/0/2","x":157.03125,"y":0.6875,"width":60.9375,"height":23.4375},">":[]}},{"UIAElement":{"@":{"name":"100% battery power","label":"100% battery power","value":null,"dom":null,"enabled":true,"valid":true,"visible":true,"hint":"Swipe down with three fingers to reveal the notification center., Swipe up with three fingers to reveal the control center, Double-tap to scroll to top","path":"/0/3/0/3","x":339.84375,"y":0.6875,"width":29.296875,"height":23.4375},">":[]}}]}}]}}]}}}
info: [debug] [INST] 2015-07-08 07:55:28 +0000 Debug: Running system command #4: /usr/local/bin/node /usr/local/lib/node_modules/appium/node_modules/appium-uiauto/bin/command-proxy-client.js /tmp/instruments_sock 2,{"status":0,"value":{"UIAApplication":{"@":{"name":"MyTestADBrokerApp","label":"MyTestADBrokerApp","value":null,"dom":null,"enabled":true,"valid":true,"visible":true,...
info: [debug] [INST] 2015-07-08 07:56:13 +0000 Error: Script threw an uncaught JavaScript error: JSON Parse error: Unexpected EOF on line 2606 of bootstrap-467e3886869ec210.js
info: [debug] [INST] 2015-07-08 07:56:14 +0000 Stopped: Script was stopped by the user
info: [debug] [INST STDERR] 2015-07-08 00:56:14.163 instruments[76499:2578901] Attempting to set event horizon when core is not engaged, request ignored
info: [debug] [INST STDERR] 2015-07-08 00:56:14.164 instruments[76499:2578901] Attempting to set event horizon when core is not engaged, request ignored
info: [debug] [INST] Instruments Trace Complete (Duration : 67.506691s; Output : /tmp/appium-instruments/instrumentscli0.trace)
info: [debug] [INSTSERVER] Instruments exited with code 0
info: [debug] Cleaning up after instruments exit
info: [debug] Instruments exited unexpectedly
info: [debug] Shutting down command proxy and ignoring any errors
info: [debug] Closing socket server.
info: [debug] Instruments socket server was closed
info: [debug] Stopping iOS log capture
info: [debug] Reset not set, not ending sim or cleaning up app state
info: [debug] We were in the middle of processing a command when instruments died; responding with a generic error
info: [debug] Cleaning up appium session
error: Error getting source, can't continue finding element by XPath
info: [debug] Condition unmet after 46331ms. Timing out.
info: [debug] Responding to client with error: {"status":13,"value":{"message":"Instruments died while responding to command, please check appium logs","name":"UnknownError","origValue":"Instruments died while responding to command, please check appium logs"},"sessionId":null}
info: <-- POST /wd/hub/session/9b88836c-8e6b-4f5b-b450-705cb558d097/element 500 46336.275 ms - 230

Hi @Misanthrope,

You can use runAppInBackground(int timeInSeconds) method to hide your app certain time.

However, You can’t perform any actions on the other app as apple instruments allows only one app automation at a time. Refer Switch App to browser and back to app

you can automate two apps in android with a single driver session