Is it possible to execute adb commands through my android app?
You can do it with this:
Process process = Runtime.getRuntime().exec("your command");
BufferedReader bufferedReader = new BufferedReader(
new InputStreamReader(process.getInputStream()));
Don't forget to surround it with a try and catch statement.
Edit:
@Phix is right, ProcessBuilder would be better to use.
How to execute commands on a 3rd party app using adb commands or something similar
Take a look at UiAutomator.
It will enable you to launch a third-party app and perform any actions you want with it. In order to examine the UI and create the right locators, there's a command-line tool called uiautomatorviewer, bundled along with Android SDK.
Related Topics
Android Adb Doesn't See Device
How to Avoid the Frame Layout Is Pushed Up When the Soft Keyboard Appears
How to Fix White Screen on App Start Up
Android No on Screen Keybord ( Only Voice )
Limitations on Opening Pdf File in Android
Full Screen Without Navigation & Status Bars
How to Dismiss Notification After Action Has Been Clicked
How to Hide Action Bar for Fragment
How to Disable Recyclerview Items from Clicking
How to Disable Spinner in Android and Enable It on Button Click
How to Connect Existing Android Studio Project to Existing Github Repository
How to Get Root Access on Android Emulator
Android Studio - How to Find Valid Certification Path to Requested Target
Retrofit 2.0 - How to Get Response Body for 400 Bad Request Error
How to Enable Location Access Programmatically in Android
React-Native: Images Not Showing in Android Device; But Shows in Emulator