Connection with "No Application" via not Appium Desktop

I am trying to interact with an Android mobile phone, specifically click on “back” and “home” buttons or drag application icons on the desktop itself.

This can be achieved in latest Appium Desktop, using “No Application” option. Taking the code from that script and trying to run it in Android studio, I get into situation when Appium server says: “Error: The desired capabilities must include either an app, appPackage or browserName

Also looking through docs, I can’t see how one would create a connection to connect without specifying an application to use. I also tried empty strings and looked everywhere for a solution and found nothing so far.

Can this be accomplished and how, please?

Appium requires application under test to be set. It might be either a browser, or an app package or some existing package on the device. In case you don’t want to install any additional apps you could provide an identifier of an existing app as appPackage capability plus set noReset to true.

ok, so let me make sure that I understand this correctly:

current Appium and Appium desktop have different session launch capabilities, since Appium Desktop can launch a script in “No Application” mode, while Appium requires an application or a browser to start with.

is this correct?

Not really. This “mode” is just a preset for a particular capability set and the Desktop application itself is just an interface on top of the server application.

if that’s the case, i.e. there is no difference between Desktop and direct Appium use, there should exist a script which can start a session without specifying app or browser, a functional equivalent of Desktop’s “No Application”. What is it? How does the Desktop starts a session with “client” i.e. it’s Appium server and not specify either application or browser.