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/<YOURLAUNCHER>/databases/<.DB_FILE> "DELETE from <TABLE>"'
(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/<YOURLAUNCHER>/databases/<A_DB_FILE> ".tables"'
In order to create shortcuts you first need to know their structure in the table. Use .schema
then SELECT * <PARAMS>
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 <PKG_NAME>'
E.g.:
adb shell su -c 'am force-stop com.android.launcher'
or
adb shell su -c 'am force-stop com/cyanogendmod.trebuchet'