-
Notifications
You must be signed in to change notification settings - Fork 37
Make Your Tool
ZongXian Shen edited this page Jul 10, 2016
·
8 revisions
We should create a new Android Studio project to build our own instrumentation tool.
-
Create a
no activity
application.- Select the form factor
Phone and Tablet
. - Select the minimum SDK
API 21 Android 5.0 (Lollipop)
. - Then
add no activity
to the application.
- Select the form factor
-
Stop the
instant run
feature introduced by the new Android Studio (version >= 2).- Open the Gradle script
build.gradle(Module: app)
and remove the linecompile 'com.android.support:appcompat-v7:22.2.0'
. - Do not follow the
sync
order enforced by Android Studio now. - Open the style resource
res/values/styles.xml
and change theparent value
toparent="@android:style/Theme.Holo.Light"
. - Still in
res/values/styles.xml
, remove the following lines:<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
- Open the Android manifest
AndroidManifest.xml
and change theandroid:theme
toandroid:theme="@android:style/Theme.Holo.Light"
. -
sync
the project now.
- Open the Gradle script
-
Import the ProbeDroid API jar.
Suppose our project path isPATH_WORKSPACE/MyProject
.- Copy
ProbeDroid.jar
intoPATH_WORKSPACE/MyProject/app/libs
. - Back to Android Studio and switch to the
Project Files
panel. The jar can be seen inapp/app/libs/ProbeDroid.jar
directory. - Right click
ProbeDroid.jar
and selectAdd as Library
.
- Copy
-
Start to code your own tool.
Now we can refer to the java doc for API usage. Also, you can check out the sample tool as the example.