| 3 | #include "MaaUtils/Logger.h" |
| 4 | |
| 5 | MAA_CTRL_UNIT_NS_BEGIN |
| 6 | |
| 7 | bool Activity::parse(const json::value& config) |
| 8 | { |
| 9 | static const json::array kDefaultStartAppArgv = { |
| 10 | "{ADB}", "-s", "{ADB_SERIAL}", "shell", "monkey -p {INTENT} 1", |
| 11 | }; |
| 12 | static const json::array kDefaultStartActivityArgv = { |
| 13 | "{ADB}", "-s", "{ADB_SERIAL}", "shell", "am start -n {INTENT}", |
| 14 | }; |
| 15 | static const json::array kDefaultStopAppArgv = { |
| 16 | "{ADB}", "-s", "{ADB_SERIAL}", "shell", "am force-stop {INTENT}", |
| 17 | }; |
| 18 | |
| 19 | return parse_command("StartApp", config, kDefaultStartAppArgv, start_app_argv_) |
| 20 | && parse_command("StartActivity", config, kDefaultStartActivityArgv, start_activity_argv_) |
| 21 | && parse_command("StopApp", config, kDefaultStopAppArgv, stop_app_argv_); |
| 22 | } |
| 23 | |
| 24 | bool Activity::start_app(const std::string& intent) |
| 25 | { |
nothing calls this directly
no outgoing calls
no test coverage detected