Asked  6 Months ago    Answers:  5   Viewed   32 times

How do I send an intent using Android's ADB tools?

 Answers

17
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 
Tuesday, June 1, 2021
 
Juicy
answered 6 Months ago
14

As @CommonsWare said The techniques used by NQ Mobile Security have been reported to the Android Security group, and they are working on a fix to stop this behavior from occurring. and have raised a feature request with Google hopefully they may listen to it.

http://code.google.com/p/android/issues/detail?can=2&q=33315&colspec=ID%20Type%20Status%20Owner%20Summary%20Stars&id=33315

Sunday, July 4, 2021
 
Taptronic
answered 5 Months ago
53

Here is sample code how to call another activity using context, set flag as per your requirement:

public void onReceive(Context context, Intent intent) { 

  Intent startActivity = new Intent();  
  startActivity.setClass(context, xxx.class); 
  startActivity.setAction(xxx.class.getName()); 
  startActivity.setFlags( 
              Intent.FLAG_ACTIVITY_NEW_TASK 
              | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS); 
  context.startActivity(startActivity); 
}
Wednesday, August 4, 2021
 
kat_indo
answered 4 Months ago
67

My device with Android 6.0.0, too, failed to connect, but after the official upgrade to 6.0.1, this problem was solved.

Tuesday, August 17, 2021
 
christina
answered 4 Months ago
100

To connect Android virtual machine with adb follow these step

  1. On Android home screen, press ALT+F1 (Left alt). This will open a terminal with root access.

  2. Inside the terminal, type dhcpcd eth0. Execute the command twice, if you get an error or no result. This will give you an IP addresss. Now press ALT+F7 for close the terminal.

  3. Verify your IP address using the command ping <your IP Address>

  4. From the android terminal, type adb tcpip 5555. This will restart adb in tcpip mode.

  5. From your main OS terminal, type adb connect <your IP address>

Wednesday, September 8, 2021
 
Ujjawal Khare
answered 3 Months ago
Only authorized users can answer the question. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :
 
Share