Skip to content

Commit

Permalink
fix: keep resume behavior as activateApp (#746)
Browse files Browse the repository at this point in the history
* fix: follow monkey behavior

* revert, but do not set -f for now

* set only FLAG_ACTIVITY_NEW_TASK by following monkey

* set 102

* update appium adb

* keep monkey
  • Loading branch information
KazuCocoa authored May 23, 2022
1 parent b702157 commit fea7623
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions lib/commands/app-management.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,10 @@ commands.activateApp = async function activateApp (appId) {
'am', (apiLevel < 26) ? 'start' : 'start-activity',
'-a', 'android.intent.action.MAIN',
'-c', 'android.intent.category.LAUNCHER',
// FLAG_ACTIVITY_REORDER_TO_FRONT | FLAG_ACTIVITY_BROUGHT_TO_FRONT | FLAG_ACTIVITY_NEW_TASK
'-f', '0x10420000',
// FLAG_ACTIVITY_NEW_TASK | FLAG_ACTIVITY_RESET_TASK_IF_NEEDED
// https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_NEW_TASK
// https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_RESET_TASK_IF_NEEDED
'-f', '0x10200000',
'-n', await this.adb.resolveLaunchableActivity(appId),
]);
this.log.debug(stdout);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"@appium/base-driver": "^8.5.2",
"@appium/support": "^2.58.0",
"@babel/runtime": "^7.0.0",
"appium-adb": "^9.5.0",
"appium-adb": "^9.6.0",
"appium-chromedriver": "^5.0.1",
"asyncbox": "^2.8.0",
"axios": "^0.x",
Expand Down

0 comments on commit fea7623

Please sign in to comment.