-
Notifications
You must be signed in to change notification settings - Fork 112
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
Add 300ms sleep before calling apk.start. #352
Conversation
The commit seems empty, though I don't think adding a 300ms delay to fix a race condition is a proper way to fix these things. |
The app is started with |
One thing that occurred to me - we don't strictly need the PID, it's just to output the logcat results. If we can wrangle logcat to filter based on activity name we might also be fine (though - we may also introduce problems if we have multiple of the same activities running). |
@Jasper-Bekkers It doesn't seem like the All apps run under a unique user ( Alas, Google has already solved this problem for Android Studio - we just have to look up how they solve this problem instead of reinventing the wheel. |
Sorry for the empty commit- I believe it's resolved now. Thanks for being patient! I'd agree a more proper solution is warranted here, and I'd be happy to contribute that! Though I'm somewhat unfamiliar with the rust (and android-rust) ecosystem, so I'd appreciate some guidance along the way. For reference, this is how Google achieves this in their bazel tooling, which I would presume could be considered close to if not the "gold standard" for Android deployment (this is likely similar or the same as is done internally): https://github.com/bazelbuild/bazel/blob/f65a0d6a87619022de5a6a28ddd7a30ea3cf3186/tools/android/incremental_install.py#L782-L797 |
@jingchan Are you sure this change change solves the problem? You inserted the timeout in between Instead, should the timeout reside in between Do you think the installation/app-replacement is still running in the background at that point, causing Alas, the Bazel build script doesn't seem to wait for the activity to start nor tries to acquire a PID, so it's different. For testing, can you test if the |
Closing for not seeing any followup on the questions and suggestions posed above. Besides, the |
Adding a short delay here appears to fix rust-mobile/cargo-apk#10 at least for my system.
First time contributing, so please let me know if there are other conventions I should follow.
Thanks!