Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to start an Android application from the command line? [duplicate]

How to start an Android application from the command line?

There are similar question asked, but I can not find good any answers.

like image 350
dongshengcn Avatar asked Jul 07 '11 16:07

dongshengcn


People also ask

How do I duplicate apps on Android?

Open the Settings app. Scroll down, tap Utilities, and tap Parallel Apps. You'll see a list of apps that you can make copies of—not every app is supported. Find the app you want to clone, and turn its toggle to the On position.

Can I download the same app twice?

Some Android devices offer native support for app cloning. It lets you run multiple copies of the same app without having to install any third-party tool. This feature is available on Samsung, Xiaomi, Oppo, and OnePlus phones, among others. More brands may well adopt this functionality in the future.

How do I start the Android command line tool?

Last updated: March 11, 2018 Android FAQ: How do I start the Android command line tool (so I can interact with my Android emulator or device)? You start the Android command line with the adb shell command: This makes at least two assumptions: You have the Android SDK installed. You have an Android emulator (or physical device) running.

How do I build and run an app on Android emulator?

Build and package your app into an APK as described in Build and Run Your App . Start the emulator from the command line as described in the previous section, using any startup options necessary. Install your app using adb . Run and test your app on the emulator.

Can you build an android program with C?

Building an Android App from the Command Line Building an Android App from the Command Line (4 January 2017) I have been learning a bit of Android programming recently (late to the party, I know). One thing that frustrated me was figuring out how to actually build an Android program. Things are simple enough with C.

How do I install an Android app on a virtual device?

In addition to installing an app through Android Studio or the emulator UI, you can install your app on a virtual device by using the adb utility. To install an app by using adb, and then run and test the app, follow these general steps: Build and package your app into an APK as described in Build and Run Your App.


2 Answers

adb shell am start -n com.package.name/com.package.name.ActivityName 

Or you can use this directly:

adb shell am start -n com.package.name/com.package.name.ActivityName 

You can also specify actions to be filter by your intent-filters:

am start -a com.example.ACTION_NAME -n com.package.name/com.package.name.ActivityName 
like image 195
Cristian Avatar answered Sep 28 '22 07:09

Cristian


You can use:

adb shell monkey -p com.package.name -c android.intent.category.LAUNCHER 1 

This will start the LAUNCHER Activity of the application using monkeyrunner test tool.

like image 34
AliSh Avatar answered Sep 28 '22 07:09

AliSh