breautek commented on issue #698:
URL: https://github.com/apache/cordova-android/issues/698#issuecomment-632300908


   A bit more information n this issue.
   
   Cordova repeately does `ps` command in the adb shell
   
   
https://github.com/apache/cordova-android/blob/e86b211cd18e3df1932a970d2f431b208a98ae42/bin/templates/cordova/lib/emulator.js#L356
   
   And looks for `android.process.acore`. On a fresh boot of the emulator 
running `ps` command on the emulator I clearly see this process. Over time 
however `ps` returns:
   
   ```
   generic_x86_arm:/ $ ps
   USER            PID   PPID     VSZ    RSS WCHAN            ADDR S NAME       
                
   shell          5113  25902   12176   3848 0                   0 R ps
   shell         25902    386   12932   3124 __ia32_co+          0 S sh
   ```
   
   Even `ps -A` to return all processes, including processes owned by root 
fails to have `android.process.acore` listed.
   
   Further research shows that `android.proces.acore` is a process responsible 
for android's 
[ContactsProvider](https://android.googlesource.com/platform/packages/providers/ContactsProvider/+/android-5.1.1_r29/AndroidManifest.xml#22)
 system.
   
   I don't believe scanning for the `android.process.acore` is a reliable way 
to determine if the system is booted. It looks like it works on cold boots, but 
eventually the process is killed (probably when it isn't being used). Despite 
it's name, it has nothing to do with it being an android core (which I think 
was probably what the original author of the cordova codebase thought, with no 
blame)
   
   Unfortunately it seems to be very difficult to determine if the emulator is 
ready to be used.
   
   `get prop sys.boot_completed` appears to be one approach, but not all 
simulators use it (according to SO comments). Personally if android simulators 
(from what google provides) from android 5.1 to latest (ie the android versions 
cordova-android@9 will support) all supports `sys.boot_completed` prop, I think 
that is our best path forward.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to