方便测试的 adb 命令 集合

To Get Apk from package infor
$adb shell pm path com.android.bluet

To turn on bluetooth -
$adb shell am start -a android.bluetooth.adapter.action.REQUEST_ENABLE

To open wifi-
$adb shell am start -n com.android.settings/.wifi.WifiSettings

To fetch wifi info -
$adb shell am start -n com.android.settings/.wifi.WifiInfo

To fetch wifi status -
$adb shell am start -n com.android.settings/.wifi.WifiStatusTest

To open language settings -
$adb shell am start -n com.android.settings/.LanguageSettings

To open development option -
$adb shell am start -n com.android.settings/.DevelopmentSettings

To open dateTime set-up
$adb shell am start -n com.android.settings/.DateTimeSettingsSetupWizardooth

To send gmail with subject and body to specific recipients
$adb shell am start -n com.google.android.gm/com.google.android.gm.ComposeActivityGmail -d email:address@destination.com --es subject 'Your subject goes here' --es body 'Your email body goes here'

$adb shell am start -a android.intent.action.INSERT -t vnd.android.cursor.dir/contact -e name '"+name+"' -e phone "+number+"")

To enable wifi
$ adb shell svc wifi enable

To disable wifi
$ adb shell svc wifi disable

To enable bluetooth
$adb shell service call bluetooth_manager 6

To enable Airplane mode

$adb shell settings put global airplane_mode_on 1  
$adb shell am broadcast -a android.intent.action.AIRPLANE_MODE --ez state true

To disable Airplane mode
$adb shell settings put global airplane_mode_on 0  
$adb shell am broadcast -a android.intent.action.AIRPLANE_MODE --ez state false

To launch Settings item (refer to link https://github.com/android/platform_packages_apps_settings/blob/master/AndroidManifest.xml)

$adb shell am start -a android.intent.action.POWER_USAGE_SUMMARY

You can find the intents by looking at the <action> tags in the AndroidManifest.xml file for the Settings "application" (which can be viewed on GitHub). As an example, here is the activity definition for the Settings$PowerUsageSummaryActivity:

<activity android:name="Settings$PowerUsageSummaryActivity"
        android:label="@string/power_usage_summary_title"
        android:uiOptions="none"
        android:taskAffinity=""
        android:excludeFromRecents="true">
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <action android:name="android.intent.action.POWER_USAGE_SUMMARY" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="com.android.settings.SHORTCUT" />
    </intent-filter>
    <!-- Some other stuff here... -->
</activity>
To get all gmail account information
/data/data/com.google.android.gm/database/gmail.db
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值