No 'uiautomator' process has been found

Hi guys,
I really need your help on that.
Short story: it works on windows, same test case, same device, but not on mac.
Capabilities: caps.setCapability(MobileCapabilityType.DEVICE_NAME, device.getModel());
caps.setCapability(MobileCapabilityType.UDID, device.getSerialNo());
caps.setCapability(MobileCapabilityType.PLATFORM_NAME, “Android”);
caps.setCapability(MobileCapabilityType.PLATFORM_VERSION, device.getOS());
caps.setCapability(“automationName”, “UiAutomator2”);

    caps.setCapability("appPackage", command.getAppPackage());
    caps.setCapability("appActivity", command.getAppActivity());

where : model = samsung
serialNo = 988851315459424256
os = 8.0.0
app package and activity are correct

Note: on mac’s project, I have the following functionality: before running appium tests, I establish an ADB connectivity for other functionalities. This may be a problem? The fact that the adb is already running?

Windows logs:
[Appium] Welcome to Appium v1.13.0
[Appium] Non-default server args:
[Appium] port: 28269
[Appium] loglevel: info
[Appium] Appium REST http interface listener started on 0.0.0.0:28269
[HTTP] --> GET /wd/hub/status
[HTTP] {}
[HTTP] <-- GET /wd/hub/status 200 16 ms - 68
[HTTP]
[HTTP] --> POST /wd/hub/session
[HTTP] {“desiredCapabilities”:{“appPackage”:“com.sec.android.app.myfiles”,“appActivity”:“com.sec.android.app.myfiles.common.MainActivity”,“platformVersion”:“8.0.0”,“automationName”:“UiAutomator2”,“udid”:“988851315459424256”,“platformName”:“Android”,“deviceName”:“Galaxy Note9”}}
[Appium] Appium v1.13.0 creating new AndroidUiautomator2Driver (v1.33.1) session
[Appium] Capabilities:
[Appium] appPackage: com.sec.android.app.myfiles
[Appium] appActivity: com.sec.android.app.myfiles.common.MainActivity
[Appium] platformVersion: 8.0.0
[Appium] automationName: UiAutomator2
[Appium] udid: 988851315459424256
[Appium] platformName: Android
[Appium] deviceName: Galaxy Note9
[BaseDriver] Session created with session id: f1b147c7-7ecf-4d04-9deb-c232ccb8571c
[ADB] Found 1 ‘build-tools’ folders under ‘C:\Users\Andrei\AppData\Local\Android\Sdk’ (newest first):
[ADB] C:/Users/Andrei/AppData/Local/Android/Sdk/build-tools/28.0.3
[ADB] Using ‘adb.exe’ from ‘C:\Users\Andrei\AppData\Local\Android\Sdk\platform-tools\adb.exe’
[AndroidDriver] Retrieving device list
[AndroidDriver] Using device: 988851315459424256
[ADB] Using ‘adb.exe’ from ‘C:\Users\Andrei\AppData\Local\Android\Sdk\platform-tools\adb.exe’
[AndroidDriver] No app sent in, not parsing package/activity
[ADB] Using ‘aapt.exe’ from ‘C:\Users\Andrei\AppData\Local\Android\Sdk\build-tools\28.0.3\aapt.exe’
[ADB] Using ‘apksigner.bat’ from ‘C:\Users\Andrei\AppData\Local\Android\Sdk\build-tools\28.0.3\apksigner.bat’
[UiAutomator2] Server packages are not going to be (re)installed
[UiAutomator2] Starting UIAutomator2 server 3.5.1
[UiAutomator2] Using UIAutomator2 server from ‘C:\Users\Andrei\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v3.5.1.apk’ and test from ‘C:\Users\Andrei\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk’
[UiAutomator2] Waiting up to 30000ms for UiAutomator2 to be online…
[WD Proxy] Got an unexpected response: {“code”:“ECONNRESET”}
[WD Proxy] Got an unexpected response: {“code”:“ECONNRESET”}
[AndroidDriver] Screen already unlocked, doing nothing
[UiAutomator2] UiAutomator2 did not start the activity we were waiting for, ‘com.sec.android.app.myfiles/com.sec.android.app.myfiles.common.MainActivity’. Starting it ourselves
[Appium] New AndroidUiautomator2Driver session created successfully, session f1b147c7-7ecf-4d04-9deb-c232ccb8571c added to master session list
[HTTP] <-- POST /wd/hub/session 200 11141 ms - 1042
[HTTP]
[HTTP] --> POST /wd/hub/session/f1b147c7-7ecf-4d04-9deb-c232ccb8571c/timeouts
[HTTP] {“type”:“implicit”,“ms”:30000}
[HTTP] <-- POST /wd/hub/session/f1b147c7-7ecf-4d04-9deb-c232ccb8571c/timeouts 200 64 ms - 76
[HTTP]
[HTTP] --> POST /wd/hub/session/f1b147c7-7ecf-4d04-9deb-c232ccb8571c/element
[HTTP] {“using”:“id”,“value”:“menu_search”}
[HTTP] <-- POST /wd/hub/session/f1b147c7-7ecf-4d04-9deb-c232ccb8571c/element 200 305 ms - 199
[HTTP]
[HTTP] --> POST /wd/hub/session/f1b147c7-7ecf-4d04-9deb-c232ccb8571c/element/46d5794c-55bc-4d91-923f-03326061036c/click
[HTTP] {“id”:“46d5794c-55bc-4d91-923f-03326061036c”}
[HTTP] <-- POST /wd/hub/session/f1b147c7-7ecf-4d04-9deb-c232ccb8571c/element/46d5794c-55bc-4d91-923f-03326061036c/click 200 57 ms - 76
[HTTP]
[HTTP] --> DELETE /wd/hub/session/f1b147c7-7ecf-4d04-9deb-c232ccb8571c
[HTTP] {}
[Appium] Removing session f1b147c7-7ecf-4d04-9deb-c232ccb8571c from our master session list
[HTTP] <-- DELETE /wd/hub/session/f1b147c7-7ecf-4d04-9deb-c232ccb8571c 200 388 ms - 76
[HTTP]

Mac logs:
[35m[Appium]e[39m Welcome to Appium v1.13.0
e[35m[Appium]e[39m Non-default server args:
e[35m[Appium]e[39m port: 10294
e[35m[Appium]e[39m loglevel: info
e[35m[Appium]e[39m Appium REST http interface listener started on 0.0.0.0:10294
e[35m[HTTP]e[39m e[37m–>e[39m e[37mGETe[39m e[37m/wd/hub/statuse[39m
e[35m[HTTP]e[39m e[90m{}e[39m
e[35m[HTTP]e[39m e[37m<-- GET /wd/hub/status e[39me[32m200e[39m e[90m6 ms - 68e[39m
e[35m[HTTP]e[39m e[90me[39m
e[35m[HTTP]e[39m e[37m–>e[39m e[37mPOSTe[39m e[37m/wd/hub/sessione[39m
e[35m[HTTP]e[39m e[90m{“desiredCapabilities”:{“appPackage”:“com.sec.android.app.myfiles”,“appActivity”:“com.sec.android.app.myfiles.common.MainActivity”,“platformVersion”:“8.0.0”,“automationName”:“UiAutomator2”,“udid”:“988851315459424256”,“platformName”:“Android”,“deviceName”:“SM-G955U”}}e[39m
e[35m[Appium]e[39m Appium v1.13.0 creating new AndroidUiautomator2Driver (v1.33.1) session
e[35m[Appium]e[39m Capabilities:
e[35m[Appium]e[39m appPackage: com.sec.android.app.myfiles
e[35m[Appium]e[39m appActivity: com.sec.android.app.myfiles.common.MainActivity
e[35m[Appium]e[39m platformVersion: 8.0.0
e[35m[Appium]e[39m automationName: UiAutomator2
e[35m[Appium]e[39m udid: 988851315459424256
e[35m[Appium]e[39m platformName: Android
e[35m[Appium]e[39m deviceName: SM-G955U
e[35m[BaseDriver]e[39m Session created with session id: d0a4c952-c25e-484a-b3df-894fce716594
e[35m[ADB]e[39m Found 1 ‘build-tools’ folders under ‘/Users/am037j/Library/Android/sdk’ (newest first):
e[35m[ADB]e[39m /Users/am037j/Library/Android/sdk/build-tools/29.0.0
e[35m[ADB]e[39m Using ‘adb’ from ‘/Users/am037j/Library/Android/sdk/platform-tools/adb’
e[35m[AndroidDriver]e[39m Retrieving device list
06:07:30 E/DeviceMonitor: Adb connection Error:EOF
06:07:30 E/DeviceMonitor: Connection attempts: 1
e[35m[AndroidDriver]e[39m Using device: 988851315459424256
e[35m[ADB]e[39m Using ‘adb’ from ‘/Users/am037j/Library/Android/sdk/platform-tools/adb’
e[35m[AndroidDriver]e[39m No app sent in, not parsing package/activity
e[35m[ADB]e[39m Using ‘aapt’ from ‘/Users/am037j/Library/Android/sdk/build-tools/29.0.0/aapt’
e[35m[ADB]e[39m Using ‘apksigner’ from ‘/Users/am037j/Library/Android/sdk/build-tools/29.0.0/apksigner’
e[35m[UiAutomator2]e[39m Server packages are not going to be (re)installed
e[35m[UiAutomator2]e[39m Starting UIAutomator2 server 3.5.1
e[35m[UiAutomator2]e[39m Using UIAutomator2 server from ‘/usr/local/lib/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v3.5.1.apk’ and test from ‘/usr/local/lib/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-debug-androidTest.apk’
e[35m[UiAutomator2]e[39m Waiting up to 30000ms for UiAutomator2 to be online…
e[35m[WD Proxy]e[39m Got an unexpected response: {“code”:“ECONNRESET”}
e[35m[WD Proxy]e[39m Got an unexpected response: {“code”:“ECONNRESET”}
e[35m[WD Proxy]e[39m Got an unexpected response: {“code”:“ECONNRESET”}
e[35m[UiAutomator2]e[39m The instrumentation process has been unexpectedly terminated. Retrying UiAutomator2 startup (#1 of 1)
e[35m[ADB]e[39m No ‘uiautomator’ process has been found
e[35m[UiAutomator2]e[39m Waiting up to 30000ms for UiAutomator2 to be online…
e[35m[WD Proxy]e[39m Got an unexpected response: {“code”:“ECONNRESET”}
e[35m[WD Proxy]e[39m Got an unexpected response: {“code”:“ECONNRESET”}
e[35m[WD Proxy]e[39m Got an unexpected response: {“code”:“ECONNRESET”}
e[35m[UiAutomator2]e[39m Error: The instrumentation process cannot be initialized. Make sure the application under test does not crash and investigate the logcat output.
e[35m[UiAutomator2]e[39m De[35m[UiAutomator2]e[39m at Objid ect.wnot get corappenfirmadLogtion UiAutomator2 deleteSession worked; Error was: UnknownError: An unknown server-ger.errorAndThrow (/usr/local/lib/node_modules/appium/node_mside error occurred while processing the command. Original error: Tryodules/appiingum-sup to proxy a sessport/lib/logging.js:78:13ion command with)
e[out session id
35m[UiAutomator2]e[39m at UiAutomator2Server.errorAndThrow [as startSession] (/usr/local/lib/node_modules/appium/node_modules/appium-uiautomator2-driver/lib/uiautomator2.js:203:13)
e[35m[UiAutomator2]e[39m at AndroidUiautomator2Driver.startUiAutomator2Session (/usr/local/lib/node_modules/appium/node_modules/appium-uiautomator2-driver/lib/driver.js:328:5)
e[35m[UiAutomator2]e[39m at AndroidUiautomator2Driver.createSession (/usr/local/lib/node_modules/appium/node_modules/appium-uiautomator2-driver/lib/driver.js:209:7)
e[35m[UiAutomator2]e[39m at AppiumDriver.createSession (/usr/local/lib/node_modules/appium/lib/appium.js:342:35)
e[35m[UiAutomator2]e[39m at AppiumDriver.executeCommand (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/basedriver/driver.js:319:13)
e[35m[UiAutomator2]e[39m at AppiumDriver.executeCommand (/usr/local/lib/node_modules/appium/lib/appium.js:471:14)
e[35m[UiAutomator2]e[39m at asyncHandler (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/protocol.js:352:21)
e[35m[HTTP]e[39m e[37m<-- POST /wd/hub/session e[39me[31m500e[39m e[90m15931 ms - 274e[39m
e[35m[HTTP]e[39m e[90me[39m

Have you tried to follow the recommendation?

Yes, it doesn’t crash. The app is already installed on device and it’s working on windows. I tried that with several apps. All are working from windows, but not from mac. I think it is a configuration issue from mac os, but I don’t see what it is.

Just to mention, it is the first time I set up Appium. Maybe something is not correctly configured, despite that I followed the same installation steps.

06:07:30 E/DeviceMonitor: Adb connection Error:EOF

I would check if everything is fine with adb itself first.

Can you also provide the logcat output here?

I fount the problem. Yes, ADB was the issue. Because I was initializing an ADB bridge between the device and pc with monkey runner and the solution was to close the bridge and to open another one with appium. But there is one more question? How can I set --relaxed-security programmatically?
I create a topic here: Enable --relaxed-security programmatically in Java