CodeLocator is easy to use (click on the layout element in Android Studio to confirm the corresponding view information) and is a powerful tool for quickly taking over unfamiliar projects.

 

When there are some changes or reconstruction requirements for unfamiliar projects, if you can know which activity or fragment is currently managed by clicking on the APP, it will definitely save a lot of time searching in the code. I discovered this AS plug-in: CodeLocator in a community discussion. Although it has not been updated for 2 years, I will give it a try today to see if it helps.

First download the latest version of the plug-in: ​​​​​​https://github.com/bytedance/CodeLocator/releases

In the AS settings, select the plug-in to install from local 

After installation, it will appear on the right side of our AS.

 Then dump mode is already supported at this time.

As shown in the picture, when I click on a control, I can already see the control information under which activity it belongs to and what view structure it belongs to. 

I think DUMP MODE is also helpful.

---------------------------------------------------------------------------------------------------------------- 

If we need to use his own model, we need to add some project dependencies.

// To integrate basic capabilities, just add one line of dependencies 
dependencies { 
    implementation "com.bytedance.tools.codelocator:codelocator-core:1.0.0" 
}

If you need to integrate code jumping capabilities, you need to integrate Lancet first and add the following dependencies.

dependencies {
    debugImplementation "com.bytedance.tools.codelocator:codelocator-lancet-xml:1.0.0"
    debugImplementation "com.bytedance.tools.codelocator:codelocator-lancet-activity:1.0.0"
    debugImplementation "com.bytedance.tools.codelocator:codelocator-lancet-view:1.0.0"
    debugImplementation "com.bytedance.tools.codelocator:codelocator-lancet-toast:1.0.0"
    debugImplementation "com.bytedance.tools.codelocator:codelocator-lancet-dialog:1.0.0"
    debugImplementation "com.bytedance.tools.codelocator:codelocator-lancet-popup:1.0.0"
}

Of course, I encountered a problem after this operation

I will update this problem after I solve it. Of course, I can also remove the dependency and use dump mode first, which will already help and there is no need to change the project code. 

Let’s talk about its shortcut keys. If it is his own mode, please click the robot icon to pass the DEBUG package to him for installation. If it is DUMP MODE, just run it to the real machine or emulator and click the little hand icon to let him start loading. .

Official address link:

GitHub - twlkyao/CodeLocator

 

 

 

 

Guess you like

Origin blog.csdn.net/loveseal518/article/details/131786087