CodeLocator

More: Author   ReportBugs   
Tags:

English | 简体中文

GitHub license API

一张图带你了解 CodeLocator
CodeLocator

CodeLocator 是一个包含 Android SDK 与 Android Studio 插件的 Android 工具集, 包含如下的功能(目前仅支持 Mac, Windows):

  1. 展示当前的 View 视图
  2. 展示当前的 Activity 信息
  3. 展示当前所有 Fragment 的信息
  4. 展示自定义的 App 运行时信息
  5. 展示当前应用的文件信息
  6. 实时编辑 View 的状态, 如可见性, 文本内容等
  7. 定位当前响应触摸事件的 View
  8. 获取当前 View 绑定的数据
  9. 获取当前 View 对应的绘制内容
  10. 跳转 View 的点击事件代码, findViewById, ViewHolder 的代码位置
  11. 跳转 View 的 xml 布局文件
  12. 跳转 Toast, Dialog 的显示代码位置
  13. 跳转启动当前 Activity 的代码位置
  14. 展示应用支持的所有 Schema 信息
  15. 向应用发送指定 Schema
  16. 定位项目内最新的 Apk 文件
  17. apk 文件支持右键安装
  18. 快速打开显示布局边界, 过渡绘制, 点按操作等
  19. 快速连接 Charles 代理

这些 App 正在使用 CodeLocator

douyin tiktok duoshan resso xigua
抖音 TikTok 多闪 Resso 西瓜视频
helo feishu qingbei fanqie qingyan
Helo 飞书 清北网校 番茄小说 轻颜相机
huoshan guagualong jianying fanqiefm xingfuli
抖音火山版 瓜瓜龙 剪映 番茄畅听 幸福里

集成说明

按照如下操作即可使用 CodeLocator:

  1. 在 Android Studio 中安装 CodeLocator 插件(点此下载最新版插件), 也可直接在插件商店搜索 CodeLocator
  2. App 中集成 CodeLocator
allprojects {
    repositories {
        mavenCentral()
        maven { url "https://jitpack.io" }
    }
}

// 集成基础能力, 只需要添加一行依赖即可
dependencies {
    // 依赖 androidx, 已升级 AndroidX 的项目集成下面的依赖
    implementation "com.bytedance.tools.codelocator:codelocator-core:2.0.4"
    // 未升级 AndroidX 的项目集成下面的依赖 support 版本不再维护 请升级 androidx
    implementation "com.bytedance.tools.codelocator:codelocator-core-support:2.0.0"
}

如果需要集成代码跳转能力, 需要先集成 Lancet, 同时添加如下依赖


apply plugin: 'me.ele.lancet'

dependencies {
    // 两种依赖方式
    // 依赖 lancet-all, 则包含所有 lancet 能力
    debugImplementation "com.bytedance.tools.codelocator:codelocator-lancet-all:2.0.4"

    // 分别依赖对应的 lancet 模块, 包含相对应的跳转能力
    debugImplementation "com.bytedance.tools.codelocator:codelocator-lancet-xml:2.0.4"
    debugImplementation "com.bytedance.tools.codelocator:codelocator-lancet-activity:2.0.4"
    debugImplementation "com.bytedance.tools.codelocator:codelocator-lancet-view:2.0.4"
    debugImplementation "com.bytedance.tools.codelocator:codelocator-lancet-toast:2.0.4"
    debugImplementation "com.bytedance.tools.codelocator:codelocator-lancet-dialog:2.0.4"
    debugImplementation "com.bytedance.tools.codelocator:codelocator-lancet-popup:2.0.4"

    // 如果未升级 AndroidX, 可使用下方的依赖 support 版本不再维护 请升级 androidx
    debugImplementation "com.bytedance.tools.codelocator:codelocator-lancet-all-support:2.0.0"

    debugImplementation "com.bytedance.tools.codelocator:codelocator-lancet-xml-support:2.0.0"
    debugImplementation "com.bytedance.tools.codelocator:codelocator-lancet-activity-support:2.0.0"
    debugImplementation "com.bytedance.tools.codelocator:codelocator-lancet-view-support:2.0.0"
    debugImplementation "com.bytedance.tools.codelocator:codelocator-lancet-toast-support:2.0.0"
    debugImplementation "com.bytedance.tools.codelocator:codelocator-lancet-dialog-support:2.0.0"
    debugImplementation "com.bytedance.tools.codelocator:codelocator-lancet-popup-support:2.0.0"

}

使用说明

CodeLocator 插件是一个侧边栏插件, 安装后展示在 Android Studio 的右侧, 点击可展开 初始状态如下:

codelocator_init

绿色按钮表示可点击, 灰色表示当前不可操作

点击抓取按钮后, 可获得当前应用的状态信息, 左边的图片面板可点击选择对应的 View, 按钮状态会根据当前选中的 View 做出相对应的变化

codelocator_grab

更多操作可查看文档 CodeLocator 使用说明

联系我们

如果你有任何关于 CodeLocator 的问题或建议,可以加入到微信群与我们沟通交流。

WeChat

除此之外,你也可以发邮件到邮箱:liujian.android@bytedance.com, 在邮件中详细描述你的问题。
也欢迎投递简历~

License

Copyright (c) 2024 ByteDance Inc

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

The following components are provided under an Apache 2.0 license.

  1. lancet - For details, https://github.com/eleme/lancet

  2. okhttp - For details, https://github.com/square/okhttp

  3. gson - For details, https://github.com/google/gson

Apps
About Me
GitHub: Trinea
Facebook: Dev Tools