1

I have a similar issue than this one. I want to get the same results (as much as possible) when running code inspections from Android Studio and from a console Gradle task. When running from AS, I am using an xml Profile that defines some inspection tools, e.g:

<inspection_tool class="AndroidLintContentDescription" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintHardcodedText" enabled="true" level="INFO" enabled_by_default="true" />
<inspection_tool class="AndroidLintRegistered" enabled="true" level="INFO" enabled_by_default="true" />
<inspection_tool class="AnonymousClassComplexity" enabled="true" level="WARNING" enabled_by_default="true">

I am having big differences in results from AS and console (78 items in AS "Android Lint" section vs. 38 items in the console). How can I load this Profile when running Lint from console? Is this even possible?

Regards

Community
  • 1
  • 1
jmm
  • 1,044
  • 2
  • 12
  • 38

2 Answers2

4

You can run the Android Studio inspections from command line:

<android studio path>/bin/inspect.sh

https://www.jetbrains.com/idea/help/running-inspections-offline.html

Robert
  • 434
  • 1
  • 4
  • 8
  • I'm running Android Studio 1.3.2 on Windows 8.1 and I don't see that shell file. Sounds strange to run a sh script from Windows, anyway... – jmm Nov 11 '15 at 13:11
  • It should be inspect.bat in windows. See https://www.jetbrains.com/idea/help/running-inspections-offline.html – Robert Nov 11 '15 at 21:13
0

Android Lint is only a subset of the inspections that you can run in Android Studio/IntelliJ. If you want the same results in both, you should disable any non-Android-Lint inspections in Android Studio.

Scott Barta
  • 79,344
  • 24
  • 180
  • 163
  • Thanks Scott. So, in order to get *all* the inspections defined in my Profile, I must run them from inside Android Studio? – jmm Oct 06 '14 at 19:01