How can I manage "desktop" icons I want to remove all the icons on the desktop, (and also in the bottom bar) and place new ones via ADB.
My script already removes all the apps, but icons/shortcuts remanin there!

Is there any command to do this? Or maybe a xml file or something that I can edit?

Note: I have root access.
The default launcher in my stock Android 4.2.1 and CM12 contains those home screen shortcuts in a table named favorites inside launcher.db. If that's your case then all you have to do is flush the content from that table, restart the launcher and the stuff would be gone for good.

A general query would be:

adb shell su -c 'sqlite3 /data/data/&lt;YOURLAUNCHER&gt;/databases/&lt;.DB_FILE&gt; "DELETE from &lt;TABLE&gt;"'


(Download sqlite3 if it's not present in the system.)

For my stock launcher in Android 4.2.1, the query would be:

adb shell su -c 'sqlite3 /data/data/com.android.launcher/databases/launcher.db "DELETE from favorites"'


However, you first have to analyze which .db file, and which table in particular, actually holds the relevant stuff. 


For that you can use SQLite Editor or aSQLite Manager to locate the relevant database and table. Or, you may adb pull all the launcher's database files and open them in an sqlite program on PC like DB Browser for SQLite  to find the correct table. 
For a command-line way, you can use this command to list all the tables in a supplied database:

adb shell su -c 'sqlite3 /data/data/&lt;YOURLAUNCHER&gt;/databases/&lt;A_DB_FILE&gt;  ".tables"'


In order to create shortcuts you first need to know their structure in the table. Use .schema then SELECT * &lt;PARAMS&gt; to see the content. You can take help (in making a query) from this resource. 

However, I would recommend choosing GUI over CLI to see the information about shortcuts. Also, always take backup before tweaking such stuff.


Once you're done flushing the table's content, do:

adb shell su -c 'am force-stop &lt;PKG_NAME&gt;'


E.g.:

 adb shell su -c 'am force-stop com.android.launcher'


or

adb shell su -c 'am force-stop com/cyanogendmod.trebuchet'