App crashes immediately upon loading on simulator. it's a react native app. Can anyone help

cap.setCapability(MobileCapabilityType.DEVICE_NAME,“iPhone SE” );
cap.setCapability(MobileCapabilityType.PLATFORM_NAME, “iOS”);
cap.setCapability(MobileCapabilityType.PLATFORM_VERSION, “10.3.1”);
cap.setCapability(MobileCapabilityType.UDID,"********-44E2-46D7-9EF6-8E5C119814FA");
// cap.setCapability(MobileCapabilityType.BROWSER_NAME, “Safari”);
cap.setCapability(MobileCapabilityType.AUTOMATION_NAME,AutomationName.IOS_XCUI_TEST);
cap.setCapability(MobileCapabilityType.APP, System.getProperty(“user.dir”)+"/xyz.app");

u r using real device. Lot of configuration is there to run on real device
. have u done these things?

Thank you Nischal_Sinha for your reply.
I am using simulator.

Yeah I have installed those 2 softwares . If I install app manually on simulator it is working but when i launch via automation code it is crashing upon loading.

Logs:
[Appium] Welcome to Appium v1.6.5
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
[HTTP] --> POST /wd/hub/session {“desiredCapabilities”:{“app”:"/Users/user.name/Documents/workspace/filename/xyz.app",“platformVersion”:“10.3.1”,“automationName”:“XCuiTest”,“platformName”:“iOS”,“udid”:"-44E2-46D7-9EF6-8E5C119814FA",“deviceName”:“iPhone SE”}}
[MJSONWP] Calling AppiumDriver.createSession() with args: [{“app”:"/Users/user.name/Documents/workspace/newvictor/xyz.app",“platformVersion”:“10.3.1”,“automationName”:“XCuiTest”,“platformName”:“iOS”,“udid”:“A50CE505-44E2-46D7-9EF6-8E5C119814FA”,“deviceName”:“iPhone SE”},null,null]
[BaseDriver] Event ‘newSessionRequested’ logged at 1500386228978 (14:57:08 GMT+0100 (BST))
[Appium] Creating new XCUITestDriver (v2.30.0) session
[Appium] Capabilities:
[Appium] app: ‘/Users/user.name/Documents/workspace/foldername/xyz.app’
[Appium] platformVersion: ‘10.3.1’
[Appium] automationName: ‘XCuiTest’
[Appium] platformName: ‘iOS’
[Appium] udid: ‘-44E2-46D7-9EF6-8E5C119814FA’
[Appium] deviceName: ‘iPhone SE’
[XCUITest] XCUITestDriver version: 2.30.0
[BaseDriver] Session created with session id: 004837fc-f5ef-4727-b6dc-266aae95bca7
[XCUITest] Xcode version set to ‘8.3.3’ (tools v8.3.2.0.1.1492020469)
[XCUITest] iOS SDK Version set to ‘10.3’
[BaseDriver] Event ‘xcodeDetailsRetrieved’ logged at 1500386229069 (14:57:09 GMT+0100 (BST))
[iOSSim] Constructing iOS simulator for Xcode version 8.3.3 with udid ‘A50CE505-44E2-46D7-9EF6-8E5C119814FA’
[XCUITest] Determining device to run tests on: udid: ‘-44E2-46D7-9EF6-8E5C119814FA’, real device: false
[BaseDriver] Using local app ‘/Users/user.name/Documents/workspace/filename/xyz.app’
[BaseDriver] Event ‘appConfigured’ logged at 1500386229248 (14:57:09 GMT+0100 (BST))
[XCUITest] Checking whether app ‘/Users/user.name/Documents/workspace/filename/Vxyz.app’ is actually present on file system
[XCUITest] App is present
[iOS] Getting bundle ID from app ‘/Users/user.name/Documents/workspace/newvictor/xyz.app’: ‘com.xyz.seats’
[BaseDriver] Event ‘resetStarted’ logged at 1500386229251 (14:57:09 GMT+0100 (BST))
[XCUITest] Not scrubbing third party app in anticipation of uninstall
[BaseDriver] Event ‘resetComplete’ logged at 1500386229422 (14:57:09 GMT+0100 (BST))
[iOSLog] Starting iOS 10.3 simulator log capture
[iOSLog] System log path: /Users/user.name/Library/Logs/CoreSimulator/-44E2-46D7-9EF6-8E5C119814FA/system.log
[BaseDriver] Event ‘logCaptureStarted’ logged at 1500386229514 (14:57:09 GMT+0100 (BST))
[XCUITest] Setting up simulator
[iOS] No reason to set locale
[iOS] No iOS / app preferences to set
[XCUITest] Simulator with udid ‘-44E2-46D7-9EF6-8E5C119814FA’ already booted
[BaseDriver] Event ‘simStarted’ logged at 1500386229698 (14:57:09 GMT+0100 (BST))
[XCUITest] Reset requested. Removing app with id ‘com.xyz.seats’ from the device
[XCUITest] Installing /Users/user.name/Documents/workspace/filename/xyz.app on Simulator with UUID ‘*-44E2-46D7-9EF6-8E5C119814FA’…
[XCUITest] The app has been installed successfully.
[BaseDriver] Event ‘appInstalled’ logged at 1500386234810 (14:57:14 GMT+0100 (BST))
[BaseDriver] Event ‘wdaStartAttempted’ logged at 1500386234811 (14:57:14 GMT+0100 (BST))
[XCUITest] Using WDA path: ‘/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent’
[XCUITest] Using WDA agent: ‘/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj’
[XCUITest] Launching WebDriverAgent on the device
[XCUITest] Carthage found: ‘/usr/local/bin/carthage’
[XCUITest] Killing hanging processes
[XCUITest] xcodebuild exited with code ‘null’ and signal ‘SIGKILL’
[XCUITest] Beginning test with command ‘xcodebuild build-for-testing test-without-building -project /Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination id=A50CE505-44E2-46D7-9EF6-8E5C119814FA -configuration Debug IPHONEOS_DEPLOYMENT_TARGET=10.3’ in directory ‘/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent’
[XCUITest] Output from xcodebuild will not be logged
[XCUITest] Waiting up to 60000ms for WebDriverAgent to start
[JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[XCUITest] Log file for xcodebuild test: /Users/user.name/Library/Developer/Xcode/DerivedData/WebDriverAgent-dikkwtrisltbeobjmfvpthwwekvs/Logs/Test/0FAAA312-1184-4DD9-A123-0F4B86F61251/Session-WebDriverAgentRunner-2017-07-18_145716-WPB75u.log
[JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[JSONWP Proxy] Got response with status 200: “{\n “value” : {\n “state” : “success”,\n “os” : {\n “name” : “iOS”,\n “version” : “10.3.1”\n },\n “ios” : {\n “simulatorVersion” : “10.3.1”,\n “ip” : “172.16.4.30”\n },\n “build” : {\n “time” : “Jul 18 2017 09:50:07”\n }\n },\n “sessionId” : “9C7843D9-FDCD-443A-A4DB-8D22C3906045”,\n “status” : 0\n}”
[XCUITest] WebDriverAgent running on ip ‘172.16.4.30’
[XCUITest] WebDriverAgent successfully started after 7295ms
[BaseDriver] Event ‘wdaSessionAttempted’ logged at 1500386242213 (14:57:22 GMT+0100 (BST))
[XCUITest] Sending createSession command to WDA
[JSONWP Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {“desiredCapabilities”:{“bundleId”:“com.flyvictor.seats”,“arguments”:[],“environment”:{},“shouldWaitForQuiescence”:true,“shouldUseTestManagerForVisibilityDetection”:false,“maxTypingFrequency”:60,“shouldUseSingletonTestManager”:true}}
[JSONWP Proxy] Got response with status 200: {“value”:{“sessionId”:“6129AA3F-88F1-4A09-A44B-69766CB79A95”,“capabilities”:{“device”:“iphone”,“browserName”:" “,“sdkVersion”:“10.3.1”,“CFBundleIdentifier”:“local.pid.947”}},“sessionId”:“6129AA3F-88F1-4A09-A44B-69766CB79A95”,“status”:0}
[BaseDriver] Event ‘wdaSessionStarted’ logged at 1500386249442 (14:57:29 GMT+0100 (BST))
[XCUITest] Found WDA derived data folder: ‘/Users/user.name/Library/Developer/Xcode/DerivedData/WebDriverAgent-dikkwtrisltbeobjmfvpthwwekvs’
[XCUITest] Setting ‘555’ permissions to ‘/Users/user.name/Library/Developer/Xcode/DerivedData/WebDriverAgent-dikkwtrisltbeobjmfvpthwwekvs/Logs/Test/Attachments’ folder
[BaseDriver] Event ‘wdaPermsAdjusted’ logged at 1500386249445 (14:57:29 GMT+0100 (BST))
[BaseDriver] Event ‘wdaStarted’ logged at 1500386249445 (14:57:29 GMT+0100 (BST))
[XCUITest] Setting initial orientation to ‘PORTRAIT’
[JSONWP Proxy] Proxying [POST /orientation] to [POST http://localhost:8100/session/6129AA3F-88F1-4A09-A44B-69766CB79A95/orientation] with body: {“orientation”:“PORTRAIT”}
[JSONWP Proxy] Got response with status 200: {“value”:{},“sessionId”:“6129AA3F-88F1-4A09-A44B-69766CB79A95”,“status”:0}
[BaseDriver] Event ‘orientationSet’ logged at 1500386249659 (14:57:29 GMT+0100 (BST))
[Appium] New XCUITestDriver session created successfully, session 004837fc-f5ef-4727-b6dc-266aae95bca7 added to master session list
[BaseDriver] Event ‘newSessionStarted’ logged at 1500386249660 (14:57:29 GMT+0100 (BST))
[MJSONWP] Responding to client with driver.createSession() result: {“webStorageEnabled”:false,“locationContextEnabled”:false,“browserName”:”",“platform”:“MAC”,“javascriptEnabled”:true,“databaseEnabled”:false,“takesScreenshot”:true,“networkConnectionEnabled”:false,“app”:"/Users/user.nameen/Documents/workspace/filename/xyz.app",“platformVersion”:“10.3.1”,“automationName”:“XCuiTest”,“platformName”:“iOS”,“udid”:“A50CE505-44E2-46D7-9EF6-8E5C119814FA”,“deviceName”:“iPhone SE”}
[HTTP] <-- POST /wd/hub/session 200 20685 ms - 494

R u using real device or Simulator ? If Simulator then dont use UDID its
not required directly use deviceName .

And by your log everything looks fine if it is not complete log then send
me complete log in text file.

App launches and crashes? and u mean to say it is manually working fine?

That is complete logs.

IF i don’t use UDID i am getting this Terminal error:

[XCUITest] Error: Sdk ‘10.3.1’ was not in list of simctl sdks

at getDevices,

Java Ide console error:
An unknown server-side error occurred while processing the command. Original error: Sdk ‘10.3.1’ was not in list of simctl sdks (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 675 milliseconds.

App launches and crashes? and u mean to say it is manually working fine?—>

i mean app is installing via automation , but it is crashing even if i am trying to access manually.

But same app if i build via x-code (manually) it is working fine.

ok so while inspecting it is crashing

Hi ,

Nischal it’s working correctly like this…I need to first run build on Xcode manually on to that simulator.

Then when I run the automation script then it is installing the app correctly and launching correctly.

Looks Strange for me . is this idle?

I am facing the same issue… IOS 13… Xcode 11.1, Automation works perfectly on real devices… but when it comes to simulator on iPhone 11, app launches and crashes… But when i install the app manually, It perfectly installs and works fine… Problem occurs only when the automation starts… Please advice, any help is appreciated.

Appium version : 1.15.0

1 Like