How do we execute google play store download app or existing installed app on Real device?

Hi, I’m researching how do we write Appium code on Python.
I hope to know 2 topics.

  1. How do we install and execute mobile app on google play store?
  2. How do we execute existing installed app on our Real device?

As far as I know, most of the code sample only execute “.apk” file.
I desire to execute without apk file on appium.

Could we execute it?

Thank you for reading my question.

I haven’t tried this on a google store app. I tried testing currently being developed app. What I did is to install it in the phone. Then as long as the appPackage and appActivity is correct, I can launch them and perform automation testing.

U can open playstore & donwload app easily

I had some issues as well. searching the app worked by just put a search string on Textview. Clicking on it didn’t seem to go that easy in default. Searching or using an id didn’t work. ended up just using the Xpath. When i debug on clickable it shows 7 options and they are all in the header. So for now i just used:
const installButtonXPath = “//androidx.compose.ui.platform.ComposeView/android.view.View/android.view.View/android.view.View[1]/android.view.View[3]/android.widget.Button