{"id":27402318,"url":"https://github.com/hi-dhl/devicemonitorplugin","last_synced_at":"2025-04-14T04:25:08.661Z","repository":{"id":107967313,"uuid":"168801665","full_name":"hi-dhl/DeviceMonitorPlugin","owner":"hi-dhl","description":"解决在Android Studio 3.2找不到Android Device Monitor工具","archived":false,"fork":false,"pushed_at":"2020-07-13T09:04:49.000Z","size":306,"stargazers_count":40,"open_issues_count":5,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-10-20T20:13:08.809Z","etag":null,"topics":["android-device-monitor","androidstudio","devicemotion"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hi-dhl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-02-02T06:21:48.000Z","updated_at":"2023-10-20T20:13:09.230Z","dependencies_parsed_at":null,"dependency_job_id":"5fd48ae7-e85f-435d-97f9-b8f566396694","html_url":"https://github.com/hi-dhl/DeviceMonitorPlugin","commit_stats":null,"previous_names":[],"tags_count":1,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hi-dhl%2FDeviceMonitorPlugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hi-dhl%2FDeviceMonitorPlugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hi-dhl%2FDeviceMonitorPlugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hi-dhl%2FDeviceMonitorPlugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hi-dhl","download_url":"https://codeload.github.com/hi-dhl/DeviceMonitorPlugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248820314,"owners_count":21166647,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android-device-monitor","androidstudio","devicemotion"],"created_at":"2025-04-14T04:25:08.086Z","updated_at":"2025-04-14T04:25:08.655Z","avatar_url":"https://github.com/hi-dhl.png","language":"Java","readme":"## 解决在 Android Studio 3.2 找不到 Android Device Monitor 工具\n\n\u003e 升级到 AndroidStudio 最新版本( \u003e3.2 )朋友们都会遇到一个问题，找不到 DDMS [Android Device Monitor], 只能从 SDK 目录下找到 monitor 启动 DDMS [Android Device Monitor]，所以写了一个插件快速启动 Android Device Monitor\n\n### 源码及使用方式\n\n开发工具：IntelliJ IDEA\n\n[Github地址：https://github.com/hi-dhl/DeviceMonitorPlugin](https://github.com/hi-dhl/DeviceMonitorPlugin)\n\n[插件下载地址：https://github.com/hi-dhl/DeviceMonitorPlugin/releases/download/1.0/DeviceMonitorPlugin.jar\n](https://github.com/hi-dhl/DeviceMonitorPlugin/releases/download/1.0/DeviceMonitorPlugin.jar)\n\n安装方式：\n\n* 打开 AndroidStudio\n* 选择 Preference -\u003e Plugins-\u003e install plugin from disk\n* 选择下载好的插件 [DeviceMonitorPlugin.jar] -\u003e 重启 AndroidStudio\n\n![](http://cdn.51git.cn/2020-05-30-1549102936603931.jpg)\n\n如何启动：\n\n* 打开 AndroidStudio\n* 菜单栏 tools -\u003e 单击 DeviceMonitor\n\n![](http://cdn.51git.cn/2020-05-30-15491020796229221.jpg)\n\nPS: Google 虽然删除了 AdnroidStudio 启动入口，但是本地 SDK 中还是存在，插件通过动态获取本地 SDK 路径启动 AndroidDeviceMonitor, 由于电脑性能不同，启动速度会有不同\n\n###  Google 为什么弃用 Android Device Monitor\n\n[Android Developers](https://developer.android.com/)官网上的原文[链接](https://developer.android.com/studio/profile/monitor)\n\n![Google](http://cdn.51git.cn/2019-12-12-15490930968670.jpg)\n\nAndroid Device Monitor 是一个 Android 应用调试和分析工具提供了一个 UI 工具，但是大部分组件在 Android Studio 3.1 已经弃用了, 并且会在 Android Studio 3.2 中移除，将会用新的工具帮助开发人员调试和分析 Android 应用 [详情戳这里](https://developer.android.com/studio/profile/monitor)\n\n### 插件核心代码\n\n```\npublic class Monitor extends AnAction {\n\n    @Override\n    public void actionPerformed(AnActionEvent anActionEvent) {\n\n        try {\n\n            Project project = anActionEvent.getData(PlatformDataKeys.PROJECT);\n\n            String os = AndroidUtils.getPlatformName();\n            String sdkPath = AndroidUtils.getApkLocalProperties(project);\n            if (os.toLowerCase().startsWith(\"win\")) {\n                sdkPath += File.separator + \"tools\" + File.separator + \"monitor.bat\";\n            } else {\n                sdkPath += File.separator + \"tools\" + File.separator + \"monitor\";\n            }\n\n            Runtime.getRuntime().exec(sdkPath);\n        } catch (Exception e) {\n\n        }\n\n    }\n}\n```\n\n\n```\n/**\n * 动态获取本地Android SDK的路径\n *\n * @param project\n * @return\n */\npublic static String getApkLocalProperties(Project project) {\n\n    String sdkPath = \"\";\n\n    try {\n\n        String path = project.getBasePath() + File.separator + \"local.properties\";\n\n        Properties properties = new Properties();\n        InputStream inputStream = new FileInputStream(path);\n        properties.load(inputStream);\n\n        sdkPath = properties.getProperty(\"sdk.dir\");\n    } catch (Exception e) {\n\n    }\n    return sdkPath;\n}\n```\n\n[Github地址：https://github.com/hi-dhl/DeviceMonitorPlugin](https://github.com/hi-dhl/DeviceMonitorPlugin)\n\n## 结语\n\n致力于分享一系列 Android 系统源码、逆向分析、算法、翻译、Jetpack 源码相关的文章，欢迎一起来学习，在技术的道路上一起前进，另外我还在维护其他项目 [Android10-Source-Analysis](https://github.com/hi-dhl/Android10-Source-Analysis)、[Leetcode-Solutions-with-Java-And-Kotlin](https://github.com/hi-dhl/Leetcode-Solutions-with-Java-And-Kotlin) 、[Technical-Article-Translation](https://github.com/hi-dhl/Technical-Article-Translation) 、 [AndroidX-Jetpack-Practice](https://github.com/hi-dhl/AndroidX-Jetpack-Practice) 可以前去查看。\n\n### AndroidX-Jetpack-Practice\n\n正在建立一个最全、最新的 AndroidX Jetpack 相关组件的实战项目 以及 相关组件原理分析文章，目前已经包含了 App Startup、Paging3、Hilt 等等，正在逐渐增加其他 Jetpack 新成员，仓库持续更新，可以前去查看：[AndroidX-Jetpack-Practice](https://github.com/hi-dhl/AndroidX-Jetpack-Practice)。\n\n### Android10-Source-Analysis\n\n正在写一系列的 Android 10 源码分析的文章，了解系统源码，不仅有助于分析问题，在面试过程中，对我们也是非常有帮助的，如果你同我一样喜欢研究 Android 源码，可以关注我 GitHub 上的 [Android10-Source-Analysis](https://github.com/hi-dhl/Android10-Source-Analysis)。\n\n### Leetcode-Solutions-with-Java-And-Kotlin\n\n由于 LeetCode 的题库庞大，每个分类都能筛选出数百道题，由于每个人的精力有限，不可能刷完所有题目，因此我按照经典类型题目去分类、和题目的难易程度去排序。\n\n* 数据结构： 数组、栈、队列、字符串、链表、树……\n* 算法： 查找算法、搜索算法、位运算、排序、数学、……\n\n每道题目都会用 Java 和 kotlin 去实现，并且每道题目都有解题思路，如果你同我一样喜欢算法、LeetCode，可以关注我 GitHub 上的 LeetCode 题解：[Leetcode-Solutions-with-Java-And-Kotlin](https://github.com/hi-dhl/Leetcode-Solutions-with-Java-And-Kotlin)。\n\n### Technical-Article-Translation\n\n目前正在整理和翻译一系列精选国外的技术文章，不仅仅是翻译，很多优秀的英文技术文章提供了很好思路和方法，每篇文章都会有**译者思考**部分，对原文的更加深入的解读，可以关注我 GitHub 上的 [Technical-Article-Translation](https://github.com/hi-dhl/Technical-Article-Translation)。\n\n## License\n\n```\nCopyright 2020 hi-dhl (Jack Deng)\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n   http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhi-dhl%2Fdevicemonitorplugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhi-dhl%2Fdevicemonitorplugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhi-dhl%2Fdevicemonitorplugin/lists"}