Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only try to cleanup uiautomator process if instrumentation crashes #280

Merged
merged 1 commit into from
Jan 14, 2019

Conversation

mykola-mokhnach
Copy link
Contributor

Addresses appium/appium#11978

@mstrelex Would you mind to help with testing of this PR?

@mstrelex
Copy link
Contributor

Sure, ETA: Monday (don't have the device now).

@mykola-mokhnach
Copy link
Contributor Author

Sure, have a nice weekend!

@mykola-mokhnach
Copy link
Contributor Author

🍸

// start an avd, set the language/locale, pick an emulator, etc...
// TODO with multiple devices we'll need to parameterize this
this.defaultIME = await helpers.initDevice(this.adb, this.opts);

// set up the modified UiAutomator2 server etc
await this.initUiAutomator2Server();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@@ -33,7 +33,6 @@
],
"dependencies": {
"@babel/runtime": "^7.0.0",
"adbkit": "^2.4.1",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@mstrelex
Copy link
Contributor

It works. thank you.

@dpgraham
Copy link
Contributor

@mykola-mokhnach Should I add this patch to 1.10?

@mykola-mokhnach mykola-mokhnach merged commit a133e5c into appium:master Jan 14, 2019
@mykola-mokhnach
Copy link
Contributor Author

mykola-mokhnach commented Jan 14, 2019

@dpgraham Yes, I would say this PR has a lot of goodness in it :)

@mykola-mokhnach mykola-mokhnach deleted the uia_startup branch January 15, 2019 18:25
// https://travis-ci.org/appium/appium-uiautomator2-driver/jobs/478514097#L4806
amError = null;
try {
await this.adb.shell(['am']);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this command expected?

I failed test cases in ruby_lib_core because of this line.
https://gist.github.com/KazuCocoa/244e7cff066353be5dfc8e916d292c87

The result of /Users/kazuaki/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell am which issued here was 255: command not found. Then, the error caches and it becomes an error. We can see the list of command which is available am option.

Should we ignore the error only the result is command not found?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The result of command was:

$ /Users/kazuaki/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell am
Activity manager (activity) commands:
  help
      Print this help text.
  start-activity [-D] [-N] [-W] [-P <FILE>] [--start-profiler <FILE>]
          [--sampling INTERVAL] [--streaming] [-R COUNT] [-S]
          [--track-allocation] [--user <USER_ID> | current] <INTENT>
      Start an Activity.  Options are:
      -D: enable debugging
      -N: enable native debugging
      -W: wait for launch to complete
      --start-profiler <FILE>: start profiler and send results to <FILE>
      --sampling INTERVAL: use sample profiling with INTERVAL microseconds
          between samples (use with --start-profiler)
      --streaming: stream the profiling output to the specified file
          (use with --start-profiler)
      -P <FILE>: like above, but profiling stops when app goes idle
      --attach-agent <agent>: attach the given agent before binding
      -R: repeat the activity launch <COUNT> times.  Prior to each repeat,
          the top activity will be finished.
      -S: force stop the target app before starting the activity
      --track-allocation: enable tracking of object allocations
      --user <USER_ID> | current: Specify which user to run as; if not
          specified then run as the current user.
      --stack <STACK_ID>: Specify into which stack should the activity be put.
...

The exit status was 255: command not found in $? after the command

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants