Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I am trying to launch Settings through adb using the adb monkey command, but it keeps printing out "Killed". How can I find out what is causing this?

Tags:

I am using adb shell monkey -p app.package.name -c android.intent.category.LAUNCHER 1 to try to launch the settings app so that I can turn on MTP and connect this android device to my computer, but I keep getting killed every time I enter the command in the adb shell.

How can I find out why this is happening? I have tried restarting adb, getting su privelages, and rebooting the device, but nothing changes.

Thanks in advance!

EDIT: The actual command is adb shell monkey -p com.android.settings -c android.intent.category.LAUNCHER 1

EDIT 2: Probably already known, but this happens for any package name, not just settings. Not sure if that is relevant or not :/

like image 397
A_toaster Avatar asked Jun 27 '16 10:06

A_toaster


People also ask

Why adb devices command not working?

If the ADB command is not found, most likely you need to install the Android SDK Platform-Tools package to make it available in the command prompt. Also, the phone should be in USB debugging mode.

How do I run adb from command line?

Open a command window in the folder by holding shift and right-clicking in an empty spot in the folder and selecting "Open command prompt/PowerShell here" in the menu. Then you can start using ADB — connect your phone and try . ADB devices to see if it's working. A list with attached devices should show up.


2 Answers

adb shell am start -a android.settings.SETTINGS 

To bring up developer settings (in Gingerbread at least):

adb shell am start -a com.android.settings.APPLICATION_DEVELOPMENT_SETTINGS 

Here is a bash script to demonstrate more settings - on my Nexus One, it crashes and reboots a few times...

 #!/bin/bash  # This FC's android  #      android.settings.WIMAX_SETTINGS:  # list of commands were commied from output of this: # adb shell dumpsys | grep "SETTINGS" # quick hask that seemed to work, but prob. not correct.  while read L; do   [[ -z "$L" ]] && continue   printf "\nTry [%s]\n" "$L"   adb shell am start -a ${L:: -1}  # remove trailing colon   sleep 5   printf "NOTE: Watch screen... Settings may FC and after a few seconds android will reboot\n"   adb wait-for-device done <<EOF       android.settings.DATE_SETTINGS:       com.android.settings.APPLICATION_DEVELOPMENT_SETTINGS:       android.settings.LOCATION_SOURCE_SETTINGS:       android.settings.MEMORY_CARD_SETTINGS:       android.settings.LOCALE_SETTINGS:       android.search.action.SEARCH_SETTINGS:       android.net.vpn.SETTINGS:       ACCESSIBILITY_FEEDBACK_SETTINGS:       android.settings.ACCOUNT_SYNC_SETTINGS:       com.android.settings.DISPLAY_SETTINGS:       android.settings.INPUT_METHOD_SETTINGS:       android.settings.SOUND_SETTINGS:       android.settings.WIFI_SETTINGS:       android.settings.APPLICATION_SETTINGS:       com.android.settings.SOUND_SETTINGS:       android.settings.ACCOUNT_SYNC_SETTINGS_ADD_ACCOUNT:       android.settings.MANAGE_APPLICATIONS_SETTINGS:       android.settings.SYNC_SETTINGS:       android.settings.SETTINGS:       com.android.settings.DOCK_SETTINGS:       android.settings.ADD_ACCOUNT_SETTINGS:       android.settings.SECURITY_SETTINGS:       android.settings.DEVICE_INFO_SETTINGS:       android.settings.WIRELESS_SETTINGS:       android.settings.DISPLAY_SETTINGS:       android.settings.SYSTEM_UPDATE_SETTINGS:       android.settings.MANAGE_ALL_APPLICATIONS_SETTINGS:       android.settings.DATA_ROAMING_SETTINGS:       android.settings.APN_SETTINGS:       android.settings.USER_DICTIONARY_SETTINGS:       com.android.settings.VOICE_INPUT_OUTPUT_SETTINGS:       com.android.settings.TTS_SETTINGS:       android.settings.WIFI_IP_SETTINGS:       android.search.action.WEB_SEARCH_SETTINGS:       android.settings.BLUETOOTH_SETTINGS:       android.settings.AIRPLANE_MODE_SETTINGS:       android.settings.INTERNAL_STORAGE_SETTINGS:       android.settings.ACCESSIBILITY_SETTINGS:       com.android.settings.QUICK_LAUNCH_SETTINGS:       android.settings.PRIVACY_SETTINGS: EOF  
like image 170
user3017513 Avatar answered Sep 21 '22 17:09

user3017513


Since the question is about launching the Settings, there will also be some people looking for the adb command to kill the Settings.

Here you are:

adb shell am force-stop com.android.settings 
like image 20
akircal Avatar answered Sep 23 '22 17:09

akircal