To open the Wi-Fi settings, one can use the following command:
# am start -n com.android.settings/.Settings\$AdvancedWifiSettingsActivity
Is there a similar command to open the Ethernet settings as following?
The way to launch the Ethernet Activity of the Settings, is to issue:
am start -n com.android.settings/.Settings\$EthernetSettingsActivity
in a terminal.
By the way, the method to obtain an unrefined list of all the activities in an app, is to extract such data directly from the AndroidManifest.xml. Luckily, we can accomplish this with the following terminal commands:
path=$(pm path com.android.settings)
path=${
path#p*:
}
aapt d xmltree $path AndroidManifest.xml | grep Settings\$. > /sdcard/SettingsActivities.txt
Now, the first line assigns to the variable path
the path where to find the Settings apk. This is useful if you need to include this snippet in a script, and you want to make it portable for various Android flavors.
Line 2 sanitizes the path variable, by removing the "package:" prefix set by pm path
, thus making it usable for the third line.
Line 3 does the real job: it dumps the AndroidManifest.xml of the app indicated in the path
variable. It also filters the output, in order to consider only the lines which contain "Settings$", and then outputs the result, saving it to a file with an arbitrary name (here SettingsActivities.txt), for further examination.
Q & A