Endless loop on initial launch screen - ios - native app

The app is launched and the inspector gets stuck on the loading screen of the splash page for the app, but the app splash screen loads fine.

Appium server: 1.22.0
Appium Inspector (Desktop): 2021.12.2 (also tried the web version with same issue)
platform: ios/iPhone 13/iOs 15.0 (have tried other version with same issues)
This is a react-native app and the app is fully functional without appium

Desired Caps:
{
“platformName”: “iOs”,
“appium:platformVersion”: “15.0”,
“appium:deviceName”: “iPhone 13”,
“appium:app”: “/path/to/app/app_name.app”,
“appium:automationName”: “XCUITest”,
“appium:noReset”: true
}

  • The app gets installed successfully
  • The webdriver agent gets installed successfully
  • The app is launches successfully on the device and is usable; however the appium inspector doesn’t move on beyond the loading icon to display the elements found the main page (which would be the login/create account buttons)

Inspector forever loading screen:

iOs Simulator screen while inspector stuck on loading:

Appium Server log files:
appium_server_logs.txt (25.0 KB)

try play with snapshotMaxDepth which default 50. increase it to e.g. 500.

No luck - seems like its not recognizing that … Look at the bottom on log snippet i attached - it says “The following capabilities were provided, but are not recognized by Appium” …

desired capabilities:

{
  "platformName": "iOs",
  "appium:platformVersion": "15.0",
  "appium:deviceName": "iPhone 13",
  "appium:app": "/Users/rhacopian/Downloads/alle_apps/Allē.app",
  "appium:automationName": "XCUITest",
  "appium:noReset": true,
  "appium:idleTimeout": "360",
  "appium:ImplicitlyWait": "360",
  "appium:customSnapshotTimeout": 250,
  "appium:snapshotMaxDepth": 500
}

logs:

[debug] [BaseDriver] Event 'newSessionRequested' logged at 1642084229495 (06:30:29 GMT-0800 (Pacific Standard Time))
[Appium] Appium v1.22.0 creating new XCUITestDriver (v3.53.1) session
[debug] [BaseDriver] W3C capabilities and MJSONWP desired capabilities were provided
[debug] [BaseDriver] Creating session with W3C capabilities: {
[debug] [BaseDriver]   "alwaysMatch": {
[debug] [BaseDriver]     "platformName": "iOs",
[debug] [BaseDriver]     "appium:platformVersion": "15.0",
[debug] [BaseDriver]     "appium:deviceName": "iPhone 13",
[debug] [BaseDriver]     "appium:app": "/Users/rhacopian/Downloads/alle_apps/Allē.app",
[debug] [BaseDriver]     "appium:automationName": "XCUITest",
[debug] [BaseDriver]     "appium:noReset": true,
[debug] [BaseDriver]     "appium:idleTimeout": "360",
[debug] [BaseDriver]     "appium:ImplicitlyWait": "360",
[debug] [BaseDriver]     "appium:customSnapshotTimeout": 250,
[debug] [BaseDriver]     "appium:snapshotMaxDepth": 500,
[debug] [BaseDriver]     "appium:includeSafariInWebviews": true,
[debug] [BaseDriver]     "appium:newCommandTimeout": 3600,
[debug] [BaseDriver]     "appium:connectHardwareKeyboard": true
[debug] [BaseDriver]   },
[debug] [BaseDriver]   "firstMatch": [
[debug] [BaseDriver]     {}
[debug] [BaseDriver]   ]
[debug] [BaseDriver] }
[BaseDriver] The following capabilities were provided, but are not recognized by Appium:
[BaseDriver]   idleTimeout
[BaseDriver]   ImplicitlyWait
[BaseDriver]   customSnapshotTimeout
[BaseDriver]   snapshotMaxDepth
[BaseDriver] Session created with session id: 5239b450-d7a6-42b6-80f7-793dbd1fa121

Can you try adding the udid capability? I find that is necessary when using the inspector:

"appium:udid" <your udid>

You can get the udid with one of the following commands:

idevice_id
xcrun xctrace list devices

unfortunately made no difference

Can you click the refresh button? It looks like the xml has loaded. The inspector won’t follow the activity on the phone, so sometimes you need to refresh.

Tried that as well - nothing happens, inspector seems to be frozen. I even tried appium 1.17.0 and on a totally different machine with no luck.

Ok, no idea what is going on over there but I have a few ideas to troubleshoot.

  1. Could you try building and using inspector with this RN open source app: https://github.com/cloudgrey-io/the-app
  2. If that works fine, could you compare the code of this app with yours, and go over this short article: https://appiumpro.com/editions/76-testing-react-native-apps-with-appium

Hopefully this can at least point a path forward. I’m wondering if there are any simple changes that the developers would not mind adding to make it a bit more automation friendly.

Full disclosure: I don’t work on React Native apps. Just trying to help.

Thanks for info and the guidance - anything helps at this point. I’m able to use the same inspector for other apps, so it not my environment. I have been working with Appium since beta days and have not encountered any issue similar to this.

I’m starting to think it might be more related to react-native and the heavy nesting it creates - similar to this issue that has no resolution yet … https://github.com/appium/appium/issues/14825

Not sure where to turn at this point … any guidance is welcomed.

Tagging @jlipps as last resort to see if he has encountered anything like this before or has a strategy in mind.

It looks like XCTest is unable to fetch the app accessibility tree. You may try to fetch the device logs to see more details there. Last time I saw a similar error where the cause was in an endless loop in the app code responsible for UI refresh. Check your app with Xcode instrumentation to make sure it is idling on this particular view.

@mykola-mokhnach where/how would i pull up the simulator logs to look at those things? and pointers?

simulator logs could be retrieved by xcrun simctl spawn <udid> log stream CLI command or via Xcode