title: Android: How to Know if any application is already installed in android device using adb?
body: <p>I've to install an android app with package name like "com.xyz.game" using adb.
  I want to automate the process using shell script. The process will be like if app is already installed, uninstall it(with command adb uninstall com.xyz.game) and install using "adb install game.apk" otherwise simple "adb install game.apk".</p>
  
  <p>How can I achieve this?  </p>