Not able to install app through appium

I’ve faced an issue on my Mac High Sierra and Windows 10 machines. I’ve already tried different versions of appium (1.7.2, 1.8.0, 1.8.1) and node version 8.9.1 with 5.5.1 npm version.
I’m sure that it worked correctly about a month ago but I cannot figure out what is happened now
I’m able to install the app by drag and dropping directly to an emulator

Error “ERROR: An unknown server-side error occurred while processing the command. Original error: Error occured while starting App. Original error: Error executing adbExec. Original error: ‘Command ‘C:\Users\user\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell am start -W -n com.myApp.xamarin.droid.myApp/md59f575434f825bd763d7136ca1a771623.MainActivity -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000’ timed out after 20000ms’; Stderr: ‘’; Code: ‘null’”

Here are my logs
[debug] [ADB] Device API level: 22
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running ‘C:\Users\user\AppData\Local\Android\Sdk\platform-tools\adb.exe’ with args: ["-P",5037,"-s",“emulator-5554”,“shell”,“am”,“start”,"-W","-n",“com.myApp.xamarin.droid.myApp/md59f575434f825bd763d7136ca1a771623.MainActivity”,"-S","-a",“android.intent.action.MAIN”,"-c",“android.intent.category.LAUNCHER”,"-f",“0x10200000”]
[debug] [ADB] Running ‘C:\Users\user\AppData\Local\Android\Sdk\platform-tools\adb.exe’ with args: ["-P",5037,"-s",“emulator-5554”,“shell”,“am”,“start”,"-W","-n",“com.myApp.xamarin.droid.myApp/md59f575242342343d7136ca1a771623.MainActivity”,"-S","-a",“android.intent.action.MAIN”,"-c",“android.intent.category.LAUNCHER”,"-f",“0x10200000”]
[ADB] Error: Error occured while starting App. Original error: Error executing adbExec. Original error: ‘Command ‘C:\Users\user\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell am start -W -n com.myApp.xamarin.droid.myApp/md59f575434f825bd763d7136ca1a771623.MainActivity -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000’ timed out after 20000ms’; Stderr: ‘’; Code: ‘null’
at Object.wrappedLogger.errorAndThrow (C:\Users\user\mobile\node_modules\appium\node_modules\appium-support\lib\logging.js:69:13)
at ADB.callee$0$0$ (C:\Users\user\mobile\node_modules\appium\node_modules\appium-adb\lib\tools\apk-utils.js:101:9)
at tryCatch (C:\Users\user\mobile\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Users\user\mobile\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (C:\Users\user\mobile\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js💯21)
at GeneratorFunctionPrototype.invoke (C:\Users\user\mobile\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:136:37)
at
Error: Error occured while starting App. Original error: Error executing adbExec. Original error: ‘Command ‘C:\Users\user\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell am start -W -n com.myApp.xamarin.droid.myApp/md59f575434f825bd763d7136ca1a771623.MainActivity -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000’ timed out after 20000ms’; Stderr: ‘’; Code: ‘null’
at Object.wrappedLogger.errorAndThrow (C:\Users\user\mobile\node_modules\appium\node_modules\appium-support\lib\logging.js:69:13)
at ADB.callee$0$0$ (C:\Users\user\mobile\node_modules\appium\node_modules\appium-adb\lib\tools\apk-utils.js:101:9)
at tryCatch (C:\Users\user\mobile\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Users\user\mobile\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (C:\Users\user\mobile\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js💯21)
at GeneratorFunctionPrototype.invoke (C:\Users\user\mobile\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:136:37)
at
[debug] [UiAutomator2] Deleting UiAutomator2 session
[debug] [UiAutomator2] Deleting UiAutomator2 server session
[debug] [JSONWP Proxy] Proxying [DELETE /] to [DELETE http://localhost:8200/wd/hub/session/b2147d3d-cf64-4c25-a56c-79e2dade5e17] with no body
[debug] [JSONWP Proxy] Got response with status 200: “{“sessionId”:“b2147d3d-cf64-4c25-a56c-79e2dade5e17”,“status”:0,“value”:“Session deleted”}”
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running ‘C:\Users\user\AppData\Local\Android\Sdk\platform-tools\adb.exe’ with args: ["-P",5037,"-s",“emulator-5554”,“shell”,“am”,“force-stop”,“com.myApp.xamarin.droid.myApp”]
[debug] [Logcat] Stopping logcat capture
[debug] [ADB] Removing forwarded port socket connection: 8200
[debug] [ADB] Running ‘C:\Users\user\AppData\Local\Android\Sdk\platform-tools\adb.exe’ with args: ["-P",5037,"-s",“emulator-5554”,“forward”,"–remove",“tcp:8200”]
[MJSONWP] Encountered internal error running command: Error: Error occured while starting App. Original error: Error executing adbExec. Original error: ‘Command ‘C:\Users\user\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell am start -W -n com.myApp.xamarin.droid.myApp/md59f575434f825bd763d7136ca1a771623.MainActivity -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000’ timed out after 20000ms’; Stderr: ‘’; Code: ‘null’
at Object.wrappedLogger.errorAndThrow (C:\Users\user\mobile\node_modules\appium\node_modules\appium-support\lib\logging.js:69:13)
at ADB.callee$0$0$ (C:\Users\user\mobile\node_modules\appium\node_modules\appium-adb\lib\tools\apk-utils.js:101:9)
at tryCatch (C:\Users\user\mobile\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Users\user\mobile\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (C:\Users\user\mobile\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js💯21)
at GeneratorFunctionPrototype.invoke (C:\Users\user\mobile\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:136:37)
at
[HTTP] <-- POST /wd/hub/session 500 96551 ms - 602

How much time it takes if the command adb.exe -P 5037 -s emulator-5554 shell am start -W -n com.myApp.xamarin.droid.myApp/md59f575434f825bd763d7136ca1a771623.MainActivity -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000 is executed from terminal? Also, are you sure the main activity name is correct?

It hangs without any errors when I’m trying to execute this command from the terminal.
Yes, I’ve taken activity name from Android Manifest, also if I run tests without provided activity appium defines the same activity by itself, so I’m pretty sure that this is the correct activity

Then the timeout in Appium is expected. You should find the correct combination of package/activity names to execute your app.

@mykola-mokhnach. i am facing this issue Failed: Message: An unknown server-side error occurred while processing the command. Original error: Error executing adbExec. Original error: ‘Command ‘/Users/mobile/work/android_sdk/platform-tools/adb -P 5037 -s RF8M20QEALV shell am startservice -e longitude 13.405 -e latitude 52.52 -e altitude 10 io.appium.settings/.LocationService’ exited with code 255’; Stderr: ‘Error: app is in background uid UidRecord{9bbb046 u0a8876 CEM idle change:cached procs:1 proclist:13890, seq(0,0,0)}’; Code: ‘255’.

Make sure you use the most recent server version