Hi Jonathan,
thank you for adding this change. I re-ran the test and like you thought it made no difference. I investigated the issue again by running the appium server and the application in the same terminal window so that both the appium and the application logs were shown in chronological order. What I observed is the application begins and starts processing information such as an HTTP requests and creating alerts before Web Driver comes back after starting the application. This is expected. However I also noticed a "ScriptAgent handleAlert" log before the appium server log which sent the command to instruments to set autoAcceptAlerts to false. I'm not sure what the log "This script has no onAlert" means. Is it automatically accepting the alert? It happens at around the same time of the alert being accepted automatically.
Here is the log produced by the combined appium and application log (I have put "APPLICATION LOG:" infront of the log produced by the the application and have highlighted some other parts of the log I believe may help shed some light in solving why the on app launch alerts still being automatically accepted) :
debug: Appium request initiated at /wd/hub/session
info: Unzipping /var/folders/rl/b5zs9n8j5451f1bccvl2v04c0000gn/T/114117-419-1rf15tk/appium-app.zip
info: Testing zip archive: /var/folders/rl/b5zs9n8j5451f1bccvl2v04c0000gn/T/114117-419-1rf15tk/appium-app.zip
info: Zip archive tested clean
info: Unzip successful
info: Using extracted app: /var/folders/rl/b5zs9n8j5451f1bccvl2v04c0000gn/T/114117-419-1rf15tk/MyAppMyApp.app
info: Creating new appium session adbc352a-7094-492b-be3d-7c11201827be
info: Removing any remaining instruments sockets
info: Cleaned up instruments socket /tmp/instruments_sock
info: Cleaning up any tracedirs
info: Cleaned up /Users/James/appium/instrumentscli0.trace
info: Parsed app Localizable.strings
info: Not setting locale
info: Setting iOS and app preferences
info: Starting iOS 7.* simulator log capture
info: Killing the simulator process and daemons
info: Cleaning app state.
info: No folders found to remove
debug: Launching device: iPad
info: Parsed app Info.plist
info: Wrote new app Info.plist with device type
info: Simulator is now ready.
debug: No device id or app, not installing to real device.
debug: Creating instruments
info: Instruments is at: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments
info: [INSTSERVER] Instruments socket server started at /tmp/instruments_sock
info: Spawning instruments with command: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate /var/folders/rl/b5zs9n8j5451f1bccvl2v04c0000gn/T/114117-419-1rf15tk/MyApp.app -e UIASCRIPT /Users/James/appium/lib/devices/ios/uiauto/bootstrap.js -e UIARESULTSPATH /tmp/appium-instruments/
info: And extra without-delay env: {"DYLD_INSERT_LIBRARIES":"/Users/James/appium/build/iwd/InstrumentsShim.dylib","LIB_PATH":"/Users/James/appium/build/iwd"}
info: And launch timeout: 90000ms
info: [INST STDERR] 2014-02-17 10:12:27.932 ScriptAgent[1607:2e07] CLTilesManagerClient: initialize, sSharedTilesManagerClient
info: [INST STDERR] 2014-02-17 10:12:27.933 ScriptAgent[1607:2e07] CLTilesManagerClient: init
info: [INST STDERR] 2014-02-17 10:12:27.933 ScriptAgent[1607:2e07] CLTilesManagerClient: reconnecting, 0x963cbb0
*** APPLICATION LOG: HTTP REQUESTED AND PROCESSED BY MYAPP WHICH WILL CAUSE AN ALERT TO APPEAR ***
*** APPLICATION LOG: ALERT DISPLAYED ***
info: [INSTSERVER] Instruments is ready to receive commands
info: Instruments launched. Starting poll loop for new commands.
info: Pushing command to appium work queue: "au.bundleId()"
debug: Sending command to instruments: au.bundleId()
info: [INSTSERVER] Socket data received (15 bytes)
info: [INSTSERVER] Socket data being routed for 'cmd' event
info: [INSTSERVER] Sending command to instruments: au.bundleId()
info: [INST STDERR] 2014-02-17 10:12:29.604 ScriptAgent[1607:2e07] -[ScriptAgent handleAlert:]: script status is 2
info: [INST STDERR] 2014-02-17 10:12:29.605 ScriptAgent[1607:2e07] -[ScriptAgent handleAlert:]: This script has no onAlert
(THIS IS NOT A LOG: Did the last log dismiss the alert automatically?)
info: [INSTSERVER] Socket data received (68 bytes)
info: [INSTSERVER] Socket data being routed for 'cmd' event
info: [INSTSERVER] Got result from instruments: {"status":0,"value":"com.mycompany.MyApp--bdd"}
info: Bundle ID for open app is com.mycompany.MyApp--bdd
info: Setting bootstrap config keys/values
info: Pushing command to appium work queue: "setBootstrapConfig: autoAcceptAlerts=false"
debug: Sending command to instruments: setBootstrapConfig: autoAcceptAlerts=false
info: [INSTSERVER] Sending command to instruments: setBootstrapConfig: autoAcceptAlerts=false
info: [INSTSERVER] Socket data received (68 bytes)
info: [INSTSERVER] Socket data being routed for 'cmd' event
info: [INSTSERVER] Got result from instruments: {"status":0,"value":"com.mycompany.MyApp--bdd"}
info: Setting initial orientation to PORTRAIT
info: Pushing command to appium work queue: "au.setScreenOrientation('PORTRAIT')"
debug: Sending command to instruments: au.setScreenOrientation('PORTRAIT')
info: [INSTSERVER] Sending command to instruments: au.setScreenOrientation('PORTRAIT')
info: [INSTSERVER] Socket data received (56 bytes)
info: [INSTSERVER] Socket data being routed for 'cmd' event
info: [INSTSERVER] Got result from instruments: {"status":0,"value":"PORTRAIT"}
info: Device launched! Ready for commands (will time out in 60secs)
info: Appium session started with sessionId adbc352a-7094-492b-be3d-7c11201827be
info: Setting command timeout to 120 secs
POST /wd/hub/session 303 30535ms - 9b
debug: Appium request initiated at /wd/hub/session/adbc352a-7094-492b-be3d-7c11201827be
debug: Request received with params: {}
info: Responding to client with success: {"status":0,"value":{"version":"7.0","webStorageEnabled":false,"locationContextEnabled":false,"browserName":"","platform":"MAC","javascriptEnabled":true,"databaseEnabled":false,"takesScreenshot":true,"launch":true,"device":"ipad","deviceName":"ipad","app":"
http://10.65.80.36:8080/job/APP-Build-BDD-Artifacts/lastSuccessfulBuild/artifact/iphonesimulator7.0BDD.zip","newCommandTimeout":120,"autoAcceptAlerts":false},"sessionId":"adbc352a-7094-492b-be3d-7c11201827be"}
GET /wd/hub/session/adbc352a-7094-492b-be3d-7c11201827be 200 2ms - 566b
*** APPLICATION LOG: IS NOW OPEN ACCORDING TO APPIUM/WEBDRIVER (As Selenium::WebDriver command has completed) ***
debug: Appium request initiated at /wd/hub/session/adbc352a-7094-492b-be3d-7c11201827be/element
debug: Request received with params: {"using":"xpath","value":"//text[contains(@text,\"Content Deleted\")]"}
info: Pushing command to appium work queue: "au.getElementByXpath('\\/\\/text[contains(@text,\\\"Content Deleted\\\")]')"
debug: Sending command to instruments: au.getElementByXpath('\/\/text[contains(@text,\"Content Deleted\")]')
info: [INSTSERVER] Sending command to instruments: au.getElementByXpath('\/\/text[contains(@text,\"Content Deleted\")]')
info: [INSTSERVER] Socket data received (50 bytes)
info: [INSTSERVER] Socket data being routed for 'cmd' event
info: [INSTSERVER] Got result from instruments: {"status":7,"value":null}
info: Responding to client with error: {"status":7,"value":{"message":"An element could not be located on the page using the given search parameters."},"sessionId":"adbc352a-7094-492b-be3d-7c11201827be"}
TEST FAILED: Can't find the Alert (As it has been dismissed automatically)