Appium does not reset app when starting a new session

Hi guys,

I am trying to setup Appium on Mac.
This is the workflow:

  1. Run Appium app (1.3.7)
  2. Run tests from Xcode. Tests are written by using Objective-C Selenium implementation.

It works fine on one laptop, but does not work on another. On the second laptop it is not able to reinstall the app from scratch when a new session is started. Instead it launches the app, which was already opened before. So the app is not in the initial stage (onboarding part is skipped).

Here is the log:

    info: --> GET /wd/hub/status {}

info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.7","revision":"72fbfaa116d3d9f6a862600ee99cf02f6d0e2182"},"isShuttingDown":false},"sessionId":"9bf541b2-4a0b-446a-8acb-b29866edb2d9"}
info: <-- GET /wd/hub/status 200 0.643 ms - 178 {"status":0,"value":{"build":{"version":"1.3.7","revision":"72fbfaa116d3d9f6a862600ee99cf02f6d0e2182"},"isShuttingDown":false},"sessionId":"9bf541b2-4a0b-446a-8acb-b29866edb2d9"}
info: --> GET /wd/hub/status {}
info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.7","revision":"72fbfaa116d3d9f6a862600ee99cf02f6d0e2182"},"isShuttingDown":false},"sessionId":"9bf541b2-4a0b-446a-8acb-b29866edb2d9"}
info: <-- GET /wd/hub/status 200 1.020 ms - 178 {"status":0,"value":{"build":{"version":"1.3.7","revision":"72fbfaa116d3d9f6a862600ee99cf02f6d0e2182"},"isShuttingDown":false},"sessionId":"9bf541b2-4a0b-446a-8acb-b29866edb2d9"}

info: --> POST /wd/hub/session {"desiredCapabilities":{"platformName":"iOS","noReset":"false","appium-version":"1.3.7","platformVersion":"8.3","app":"/Users/username/Library/Developer/Xcode/DerivedData/AppFolder-dcppkmojnkzdmqabffnyllsxbcwq/Build/Products/Debug-iphonesimulator/AppName.app","deviceName":"iPhone 6"}}
info: Client User-Agent string: xctest (unknown version) CFNetwork/720.3.13 Darwin/14.3.0 (x86_64)
info: Found an existing session to clobber, shutting it down first...
info: Shutting down appium session
info: [debug] Stopping ios
info: [debug] Destroying instruments client socket.
info: [debug] Closing socket server.
info: [debug] Instruments socket server was closed
info: [debug] Sending sigterm to instruments

info: [debug] [INST] 2015-05-21 10:39:08 +0000 Stopped: Script was stopped by the user
info: [IOS_SYSLOG_ROW ] May 21 12:39:08 MY-MACBOOK-39.local SpringBoard[10559]: Unable to get short BSD proc info for 10595: No such process
info: [IOS_SYSLOG_ROW ] May 21 12:39:08 MY-MACBOOK-39.local ScriptAgent[10596]: Warning - Unable to stop script because the script was already stopped.

info: [IOS_SYSLOG_ROW ] May 21 12:39:08 MY-MACBOOK-39 com.apple.CoreSimulator.SimDevice.DDE5958D-B9FA-44EE-808C-53C8AD3D931A.launchd_sim[10545] (UIKitApplication:myappid[0x2174][10595]): Service exited due to signal: Killed: 9

info: [debug] [INST STDERR] 2015-05-21 12:39:08.188 instruments[10540:234476] Attempting to set event horizon when core is not engaged, request ignored

info: [debug] [INST STDERR] 2015-05-21 12:39:08.189 instruments[10540:235302] Attempting to set event horizon when core is not engaged, request ignored
info: [debug] [INST] 2015-05-21 10:39:08 +0000 Error: Script threw an uncaught JavaScript error: JSON Parse error: Unexpected EOF on line 2597 of bootstrap-931e8d7703a594e3.js

info: [IOS_SYSLOG_ROW ] May 21 12:39:08 MY-MACBOOK-39.local SpringBoard[10559]: Application 'UIKitApplication:myapp[0x2174]' exited abnormally via signal.
info: [IOS_SYSLOG_ROW ] May 21 12:39:08 MY-MACBOOK-39 assertiond[10563]: assertion failed: 14D136 12F69: assertiond + 12334 [8E465C14-E4AE-36E9-AFBE-D28459602962]: 0x1

info: [debug] [INST STDERR] 2015-05-21 12:39:08.300 instruments[10540:234476] Attempting to set event horizon when core is not engaged, request ignored

info: [debug] [INST STDERR] 2015-05-21 12:39:08.300 instruments[10540:233573] Attempting to set event horizon when core is not engaged, request ignored

info: [debug] [INST] Instruments Trace Complete (Duration : 58.979961s; Output : /tmp/appium-instruments/instrumentscli0.trace)

info: [debug] [INSTSERVER] Instruments exited with code 0

info: [debug] Cleaning up after instruments exit
info: [debug] Stopping iOS log capture
info: [debug] Running ios sim reset flow
info: [debug] Killing the simulator process
info: [debug] Killall iOS Simulator

info: [debug] Killing any other simulator daemons
info: [IOS_SYSLOG_ROW ] May 21 12:39:08 MY-MACBOOK-39.local DTMobileIS[10568]: Could not create service named com.apple.instruments.server.services.processcontrol.posixspawn
info: [IOS_SYSLOG_ROW ] May 21 12:39:08 MY-MACBOOK-39.local DTMobileIS[10568]: *** LOG MESSAGE QUOTA EXCEEDED - SOME MESSAGES FROM THIS PROCESS HAVE BEEN DISCARDED ***

info: [debug] Cleaning sim data files

info
 Executing: xcrun simctl erase DDE5958D-B9FA-44EE-808C-53C8AD3D931A with timeout 2000 

info: [debug] Cleaning app data files

warn: Applications directory /Users/myusername/Library/Developer/CoreSimulator/Devices/DDE5958D-B9FA-44EE-808C-53C8AD3D931A/data/Containers/Bundle/Application doesn't exist. Have you run this simulator before?
info: [debug] Deleting /Users/myusername/Library/Developer/CoreSimulator/Devices/DDE5958D-B9FA-44EE-808C-53C8AD3D931A/data/Containers/Data/Application/88E84821-1A63-4060-B82E-5FD709AE6FFF

info: [debug] Deleting /Users/myusername/Library/Developer/CoreSimulator/Devices/DDE5958D-B9FA-44EE-808C-53C8AD3D931A/data/Library/Preferences/myappid.plist
info: [debug] Cleaning up appium session
info: Old session shut down OK, proceeding to new session
warn: Converting cap noReset from string to boolean. This might cause unexpected behavior.
info: [debug] The following desired capabilities were provided, but not recognized by appium. They will be passed on to any other services running on this server. : appium-version
info: [debug] Using local app from desired caps: /Users/myusername/Library/Developer/Xcode/DerivedData/AppName-dcppkmojnkzdmqabffnyllsxbcwq/Build/Products/Debug-iphonesimulator/AppName.app
info: [debug] Creating new appium session 3ff92b60-7d82-4ae1-b0d4-04373fbf57a9
info: [debug] Removing any remaining instruments sockets
info: [debug] Cleaned up instruments socket /tmp/instruments_sock
info: [debug] Setting Xcode folder
info: [debug] Setting Xcode version

info: [debug] Setting iOS SDK Version

info: [debug] Getting sdk version from xcrun with a timeout
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 6","platformVersion":"8.3"}

info: [debug] fixDevice is on
info: [debug] Final device string is: 'iPhone 6 (8.3 Simulator)'
info: [debug] iOS sim UDID is DDE5958D-B9FA-44EE-808C-53C8AD3D931A
info: [debug] Detecting automation tracetemplate

info: [debug] Not auto-detecting udid, running on sim
info: [debug] Could not parse plist file (as binary) at /Users/myusername/Library/Developer/Xcode/DerivedData/AppName-dcppkmojnkzdmqabffnyllsxbcwq/Build/Products/Debug-iphonesimulator/AppName.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/myusername/Library/Developer/Xcode/DerivedData/AppName-dcppkmojnkzdmqabffnyllsxbcwq/Build/Products/Debug-iphonesimulator/AppName.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: On some xcode 6 platforms, instruments-without-delay does not work. If you experience this, you will need to re-run appium with the --native-instruments-lib flag
info: [debug] Preparing uiauto bootstrap
info: [debug] Dynamic bootstrap dir: /Users/myusername/Library/Application Support/appium/bootstrap
info: [debug] Dynamic env: {"nodePath":"/Applications/Appium.app/Contents/Resources/node/bin/node","commandProxyClientPath":"/Applications/Appium.app/Contents/Resources/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 modify!
...
info: [debug] Dynamic bootstrap path: /Users/myusername/Library/Application Support/appium/bootstrap/bootstrap-931e8d7703a594e3.js
info: [debug] Reusing dynamic bootstrap: /Users/myusername/Library/Application Support/appium/bootstrap/bootstrap-931e8d7703a594e3.js
info: [debug] Getting device string from opts: {"forceIphone":false,"forceIpad":false,"xcodeVersion":"6.3.2","iOSSDKVersion":"8.3","deviceName":"iPhone 6","platformVersion":"8.3"}
info: [debug] fixDevice is on
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 6","platformVersion":"8.3"}
info: [debug] fixDevice is on
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] Running ios sim reset flow
info: [debug] Killing the simulator process
info: [debug] Killall iOS Simulator
info: [debug] Killing any other simulator daemons

info
info: [debug] Cleaning sim data files

 Executing: xcrun simctl erase DDE5958D-B9FA-44EE-808C-53C8AD3D931A with timeout 2000 

info: [debug] Cleaning app data files

warn: Applications directory /Users/myusername/Library/Developer/CoreSimulator/Devices/DDE5958D-B9FA-44EE-808C-53C8AD3D931A/data/Containers/Bundle/Application doesn't exist. Have you run this simulator before?
info: Couldn't find app directories to delete. Probably it's not installed
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] No device id or app, not installing to real device.
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/myusername/Library/Developer/Xcode/DerivedData/AppName-dcppkmojnkzdmqabffnyllsxbcwq/Build/Products/Debug-iphonesimulator/AppName.app -e UIASCRIPT "/Users/myusername/Library/Application Support/appium/bootstrap/bootstrap-931e8d7703a594e3.js" -e UIARESULTSPATH /tmp/appium-instruments
info: [debug] And extra without-delay env: {"DYLD_INSERT_LIBRARIES":"/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-instruments/thirdparty/iwd6/InstrumentsShim.dylib","LIB_PATH":"/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-instruments/thirdparty/iwd6"}
info: [debug] And launch timeouts (in ms): {"global":90000}

info: [debug] [INST] Waiting for device to boot...

info: [debug] [INST STDERR] 2015-05-21 12:39:11.616 instruments[10775:235558] WebKit Threading Violation - initial use of WebKit from a secondary thread.

info: [IOS_SYSLOG_ROW ] May 21 12:39:11 MY-MACBOOK-39 syslogd[10783]: --- syslogd restarted ---
info: [IOS_SYSLOG_ROW ] May 21 12:39:11 MY-MACBOOK-39 syslogd[10783]: Configuration Notice:
info: [IOS_SYSLOG_ROW ] ASL Module "com.apple.cloudd" claims selected messages.
info: [IOS_SYSLOG_ROW ] Those messages may not appear in standard system log files or in the ASL database.
info: [IOS_SYSLOG_ROW ] May 21 12:39:11 MY-MACBOOK-39 syslogd[10783]: Configuration Notice:
info: [IOS_SYSLOG_ROW ] ASL Module "com.apple.testmanagerd" claims selected messages.
info: [IOS_SYSLOG_ROW ] Those messages may not appear in standard system log files or in the ASL database.
info: [IOS_SYSLOG_ROW ] May 21 12:39:11 MY-MACBOOK-39 com.apple.CoreSimulator.SimDevice.DDE5958D-B9FA-44EE-808C-53C8AD3D931A.launchd_sim[10781]: assertion failed: 14D136: launchd_sim + 164366 [0442297D-31AD-37EE-96E2-C009D4F546D8]: 0xd
info: [IOS_SYSLOG_ROW ] May 21 12:39:11 MY-MACBOOK-39 com.apple.CoreSimulator.SimDevice.DDE5958D-B9FA-44EE-808C-53C8AD3D931A.launchd_sim[10781] (com.apple.assertiond): This service is defined to be constantly running and is inherently inefficient.
info: [IOS_SYSLOG_ROW ] May 21 12:39:11 MY-MACBOOK-39 com.apple.CoreSimulator.SimDevice.DDE5958D-B9FA-44EE-808C-53C8AD3D931A.launchd_sim[10781] (com.apple.assetsd.nebulad): The JetsamProperties key is not available on this platform.
info: [IOS_SYSLOG_ROW ] May 21 12:39:11 MY-MACBOOK-39 com.apple.CoreSimulator.SimDevice.DDE5958D-B9FA-44EE-808C-53C8AD3D931A.launchd_sim[10781] (com.apple.assetsd.notificationServer): The HideUntilCheckIn property is an architectural performance issue. Please transition away from it.
info: [IOS_SYSLOG_ROW ] May 21 12:39:11 MY-MACBOOK-39 com.apple.CoreSimulator.SimDevice.DDE5958D-B9FA-44EE-808C-53C8AD3D931A.launchd_sim[10781] (com.apple.assetsd): The JetsamProperties key is not available on this platform.
info: [IOS_SYSLOG_ROW ] May 21 12:39:11 MY-MACBOOK-39 com.apple.CoreSimulator.SimDevice.DDE5958D-B9FA-44EE-808C-53C8AD3D931A.launchd_sim[10781] (com.apple.backboardd): Unknown key for Boolean: HighPriorityIO
info: [IOS_SYSLOG_ROW ] May 21 12:39:11 MY-MACBOOK-39 com.apple.CoreSimulator.SimDevice.DDE5958D-B9FA-44EE-808C-53C8AD3D931A.launchd_sim[10781] (com.apple.backboardd): This service is defined to be constantly running and is inherently inefficient.
info: [IOS_SYSLOG_ROW ] May 21 12:39:11 MY-MACBOOK-39 com.apple.CoreSimulator.SimDevice.DDE5958D-B9FA-44EE-808C-53C8AD3D931A.launchd_sim[10781] (com.apple.calaccessd.xpc): The HideUntilCheckIn property is an architectural performance issue. Please transition away from it.
info: [IOS_SYSLOG_ROW ] May 21 12:39:11 MY-MACBOOK-39 com.apple.CoreSimulator.SimDevice.DDE5958D-B9FA-44EE-808C-53C8AD3D931A.launchd_sim[10781] (com.apple.calaccessd): The JetsamProperties key is not available on this platform.
info: [IOS_SYSLOG_ROW ] May 21 12:39:11 MY-MACBOOK-39 com.apple.CoreSimulator.SimDevice.DDE5958D-B9FA-44EE-808C-53C8AD3D931A.launchd_sim[10781] (com.apple.certui.relay): ThrottleInterval set to zero. You're not that important. Ignoring.
info: [IOS_SYSLOG_ROW ] May 21 12:39:11 MY-MACBOOK-39 com.apple.CoreSimulator.SimDevice.DDE5958D-B9FA-44EE-808C-53C8AD3D931A.launchd_sim[10781] (com.apple.certui.relay): The JetsamProperties key is not available on this platform.
info: [IOS_SYSLOG_ROW ] May 21 12:39:11 MY-MACBOOK-39 com.apple.CoreSimulator.SimDevice.DDE5958D-B9FA-44EE-808C-53C8AD3D931A.launchd_sim[10781] (com.apple.cloudphotod): The JetsamProperties key is not available on this platform.

info: [IOS_SYSLOG_ROW ] May 21 12:39:11 MY-MACBOOK-39.local configd_sim[10802]: network changed: v4(en3+:10.100.100.253, en0+:10.100.101.60) DNS+ Proxy+
info: [IOS_SYSLOG_ROW ] May 21 12:39:11 MY-MACBOOK-39.local securityd[10808]: unable to access hwaes key

Thanks!