I’m trying to build android using my script. Now in my build’s root folder, I’m executing the following:
os.system("source build/envsetup.sh")
os.system("choosecombo 1 <chipsetname> <buildtype>")
os.system("make -j32")
and I even tried this:
os.system("source build/envsetup.sh;choosecombo 1 <chipsetname> <buildtype>;make -j32")
Any idea where am I wrong?
I know that os.system executes in a new subshell. Thus, shouldn’t it execute the 2nd option in the same subshell?
Each call to os.system is done in a NEW subshell, so treat each call as an independant call, you can’t rely on something done before to (like sourcing a shell script) to do something else.
If the second way works in a standard shell, it should work in an
os.systemcall.