is there a way to automatize the setup/configuration of an android device? i'm used to setup computers with linux-distributions pretty often, so i partly automatized it with a shell script...
now also the amount of android-devices i have to setup/configure starts to increase and i'm wondering if there is a applicable way to automatize it.

is there a android-app, a desktop software (linux preferred) or some other way (maybe adb and a script) to set several system-settings, uninstall/deactivate pre-installed apps, install apps and maybe also set their settings.

the devices are completely mixed but all used without google-account! - phones and tablets are from different manufactures with no particular android version; also some devices run with custom roms but not all will be rooted.

i know the demands are pretty high, so i'm afraid there won't be an exact answer which accomplishes everything and therefore also answers with partial successes (e.g. restricted to special android-versions, rooted devices, etc.) or also ideas/hints in a good direction will be welcome!

this question was inspired by @gyuriscs question on Software Recommendations: https://softwarerecs.stackexchange.com/questions/38977/configuring-android-phones-from-pc
There are a few things you can do.

As far as system settings go, you're not going to automate that part without root unless you're rolling your own images from source (I doubt that you're doing that and don't recommend you try). The vast majority of settings are merely entries in a SQLite Database somewhere, so if you can find the required SQLite files, you can manipulate them directly if you are rooted. This can be scripted.

ADB can install the software you need. Use the following command:

adb install path/to/your/Android/executable.apk


Alternatively, to remove software, use:

adb uninstall package.name


(Note that I said package name, and not user-friendly name. The package name is the one that looks like com.company.product)