Hi.
I need get the list of apps/packages installed in Android using command in Terminal.
Just like for android in windows:
final String _shellCommand = "/c adb shell pm list packages";
final String _command = "cmd.exe";
ProcessBuilder builder = new ProcessBuilder(_command, _shellCommand);
Above snippet displays all the packages installed in Android device.But i need to do same thing in Mac Environment.
1.Opening the Terminal.
2.Executing the adb command to get the list of packages.
You didn’t state Simulator in your original post. In fact, here is what you said:
So next time try to state what you want. No one can help you if you can’t be bothered to ask a question in a way that pertains to your situation. The commands I gave you will work, with a device.
That said, there is no way to do this on Simulator.
Using Mac to get the list of all packages on your Simulator/Device, the adb command wouldn’t change. What might change is the way to run the command : Process process = Runtime.getRuntime().exec(command);
where the command you might want to use is adb shell pm list packages