1

I want to execute two commands in the same line on Android terminal emulator.

Example: the two commands svc wifi disable and `exit

I want to create a widget to disable the WLAN and out of the terminal emulator app at the same time, and in the terminal emulator app widget, I can only put one command.

widget entry

Andrew T.
  • 15,988
  • 10
  • 74
  • 123
MBZ XI
  • 53
  • 1
  • 5

2 Answers2

2

If you want to execute each command only if the previous one succeeded, then combine them using the && operator:

Your code should be as follows:

svc wifi disable && exit

It will work only if your first command successfully execute.

Andrew T.
  • 15,988
  • 10
  • 74
  • 123
2

Like Andrew correctly said, with && you can combine them but you also can just add more than one command by ending each command by a ";", e.g. put into the arguments field (leave empty the command field):

svc wifi disable; exit
franc
  • 417
  • 5
  • 9