作者热门文章
- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我正在使用 adb shell monkey -p app.package.name -c android.intent.category.LAUNCHER 1
尝试启动设置应用程序,以便我可以打开 MTP 并连接它android 设备连接到我的电脑,但每次我在 adb shell 中输入命令时,我总是killed
。
我如何找出发生这种情况的原因?我已尝试重新启动 adb,获取 su
权限,并重新启动设备,但没有任何变化。
提前致谢!
编辑:实际命令是 adb shell monkey -p com.android.settings -c android.intent.category.LAUNCHER 1
编辑 2:可能已经为人所知,但这适用于任何包名称,而不仅仅是设置。不确定这是否相关:/
最佳答案
adb shell am start -a android.settings.SETTINGS
调出开发者设置(至少在 Gingerbread 中):
adb shell am start -a com.android.settings.APPLICATION_DEVELOPMENT_SETTINGS
这是一个用于演示更多设置的 bash 脚本 - 在我的 Nexus One 上,它崩溃并重新启动了几次...
#!/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
关于android - 我正在尝试使用 adb monkey 命令通过 adb 启动设置,但它一直打印出 "Killed"。我怎样才能找出造成这种情况的原因?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38051706/
我是一名优秀的程序员,十分优秀!