Run scripts on android devices without being connected via USB nor the same wifiRun scripts on android devices without being connected via USB nor the same wifi

I would like to have the following architecture:

Allocate appium in a server… (a remote server)
I would like to run the unit test script directly on android device without being connected via USB to a computer. Is it possible to run the unit test script directly on the device or somehow embed script into application and execute it from there?

is this what you are looking for?