How to find ADB root path programatically?

I am developing a plugin for Android Studio. For that, I need adb support.

If the development machine configured with ADb (setting environment variable), it is easy to execute commands. But the system is not configured with ADB, I need the root path for ADB.

So how to find the ADB path that Android Studio is using by programmatically?

0
10 comments

org.jetbrains.android.sdk.AndroidSdkUtils#getAdb

0

It is not resolved in my project. Maybe the jar is not with me. Can you please help me to find out the jar?

 

0

It is part of Android Studio, nothing special.

0

I am developing in IntelliJ IDEA CE. There is no package with org.jetbrains.android.*

 

 

The external libs

0

Then you didn't include Android plugin as required dependency or did not choose AS as target IDE.

http://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/plugin_compatibility.html

0

my plugin.xml looks like

<!--<depends>com.intellij.modules.lang</depends>-->

<depends>com.intellij.modules.java</depends>

<extensions defaultExtensionNs="com.intellij">
<!-- Add your extensions here -->
<toolWindow id="Json Parser" anchor="right"
factoryClass="com.jsonparse.ParserToolWindowFactory"/>
</extensions>
<actions>

<action id="ParserActionId" class="com.jsonparse.ui.action.OpenParserAction" text="Json Parser"
description="Open in Json Parser">
<add-to-group group-id="EditMenu" anchor="last"/>
<keyboard-shortcut keymap="$default" first-keystroke="ctrl shift alt J" second-keystroke="ctrl alt J"/>
</action>

</actions>
<project-components>
<component>
<implementation-class>com.jsonparse.ParserComponent</implementation-class>
</component>
</project-components>

Previously I only have

<depends>com.intellij.modules.lang</depends>. But I have added 

<depends>com.intellij.modules.java</depends>

And I rebuild my code, But there is no change

0

<depends>com.intellij.modules.androidstudio</depends> This one is getting error.

 

0

You must either add Android plugin to classpath of your IntelliJ Platform SDK or use Android Studio as Platform SDK instead of IntelliJ CE.

See http://www.jetbrains.org/intellij/sdk/docs/basics/plugin_structure/plugin_dependencies.

 

0

So how can I convert this existing source to Android Plugin?

http://www.jetbrains.org/intellij/sdk/docs/basics/plugin_structure/plugin_dependencies this website is not available

0

Sorry, correct link is www.jetbrains.org/intellij/sdk/docs/basics/plugin_structure/plugin_dependencies.html. It has all instructions how to setup/modify setup your project.

0

Please sign in to leave a comment.