title: Can python script know the return value of C++ main function in the Android environment
body: <p>There are several ways of calling C++ executable programs. For example, we can use  </p>
  
  <pre><code> def run_exe_return_code(run_cmd):
          process=subprocess.Popen(run_cmd,stdout=subprocess.PIPE,shell=True)
          (output,err)=process.communicate()
          exit_code = process.wait()
          print output
          print err
          print exit_code
          return exit_code
  </code></pre>
  
  <p>to process a C++ executable program: <code>run_exe_return_code('abc')</code> while <code>abc</code> is created by the following C++ codes:</p>
  
  <pre><code>int main()
  {
        return 1;
  }
  </code></pre>
  
  <p>In the above codes, the return value of the program is 1, and if we run this Python script in Linux we can always see the return value by the Python script is 1. However, in Android environment it seems that the return exit code in the above python script is  0, which means successful. Is there a solution where the Python script can know the return value of main function in Android environment? </p>
  
  <p>By the way, in android environment, I use <code>adb shell abc</code> instead of <code>abc</code> in order to run the program.</p>