automating-android-unit-test-apps-xamarin-like-a-pro

First Off..

This article is for those of you out there who use Xamarin to write Android applications and want to automate the process of running your tests on an Android device. I’ll show you how you can set this up with relative ease.

Here is the process we want:

  1. CI Build Begins
  2. Produces the APK file containing my tests.
  3. Starts up an Emulator and boots an AVD
  4. Installs the tests APK onto the Android Device (Emulated)
  5. Kicks of the tests
  6. Reports back the test results.
  7. If using Team City the test all appear nicely in the UI - otherwise the results are in STDOUT.

Unit Test App (Android) - and it’s shortcomings.

It all begins with adding the unit tests project itself. Xamarin have provided a project type in Visual Studio called a “Unit Test App”. Add one of those projects to your Solution and define some tests.

New Android Unit Test Project.PNG

Here are some tests:

   1
   2
   3
   4
   5
   6
   7
   8
   9
  10
  11
  12
  13
  14
  15
  16
  17
  18
  19
  20
  21
  22
  23
  24
  25
  26
  27
  28
  29
  30
  31
  32
  33
  34
  35
  36
  37
  38
  39
  40
  41
  42
  43
  44
  45
  46
  47
  48
  49
  50
  51
  52
  53
  54
  55
  56
  57
  58
  59
  60
  61
  62
  63
  64
  65
  66
  67
  68
  69
  70
  71
  72
  73
  74
  75
  76
  77
  78
  79
  80
  81
  82
  83
  84
  85
  86
  87
  88
  89
  90
  91
  92
  93
  94
  95
  96
  97
  98
  99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 279
 280
 281
 282
 283
 284
 285
 286
 287
 288
 289
 290
 291
 292
 293
 294
 295
 296
 297
 298
 299
 300
 301
 302
 303
 304
 305
 306
 307
 308
 309
 310
 311
 312
 313
 314
 315
 316
 317
 318
 319
 320
 321
 322
 323
 324
 325
 326
 327
 328
 329
 330
 331
 332
 333
 334
 335
 336
 337
 338
 339
 340
 341
 342
 343
 344
 345
 346
 347
 348
 349
 350
 351
 352
 353
 354
 355
 356
 357
 358
 359
 360
 361
 362
 363
 364
 365
 366
 367
 368
 369
 370
 371
 372
 373
 374
 375
 376
 377
 378
 379
 380
 381
 382
 383
 384
 385
 386
 387
 388
 389
 390
 391
 392
 393
 394
 395
 396
 397
 398
 399
 400
 401
 402
 403
 404
 405
 406
 407
 408
 409
 410
 411
 412
 413
 414
 415
 416
 417
 418
 419
 420
 421
 422
 423
 424
 425
 426
 427
 428
 429
 430
 431
 432
 433
 434
 435
 436
 437
 438
 439
 440
 441
 442
 443
 444
 445
 446
 447
 448
 449
 450
 451
 452
 453
 454
 455
 456
 457
 458
 459
 460
 461
 462
 463
 464
 465
 466
 467
 468
 469
 470
 471
 472
 473
 474
 475
 476
 477
 478
 479
 480
 481
 482
 483
 484
 485
 486
 487
 488
 489
 490
 491
 492
 493
 494
 495
 496
 497
 498
 499
 500
 501
 502
 503
 504
 505
 506
 507
 508
 509
 510
 511
 512
 513
 514
 515
 516
 517
 518
 519
 520
 521
 522
 523
 524
 525
 526
 527
 528
 529
 530
 531
 532
 533
 534
 535
 536
 537
 538
 539
 540
 541
 542
 543
 544
 545
 546
 547
 548
 549
 550
 551
 552
 553
 554
 555
 556
 557
 558
 559
 560
 561
 562
 563
 564
 565
 566
 567
 568
 569
 570
 571
 572
 573
 574
 575
 576
 577
 578
 579
 580
 581
 582
 583
 584
 585
 586
 587
 588
 589
 590
 591
 592
 593
 594
 595
 596
 597
 598
 599
 600
 601
 602
 603
 604
 605
 606
 607
 608
 609
 610
 611
 612
 613
 614
 615
 616
 617
 618
 619
 620
 621
 622
 623
 624
 625
 626
 627
 628
 629
 630
 631
 632
 633
 634
 635
 636
 637
 638
 639
 640
 641
 642
 643
 644
 645
 646
 647
 648
 649
 650
 651
 652
 653
 654
 655
 656
 657
 658
 659
 660
 661
 662
 663
 664
 665
 666
 667
 668
 669
 670
 671
 672
 673
 674
 675
 676
 677
 678
 679
 680
 681
 682
 683
 684
 685
 686
 687
 688
 689
 690
 691
 692
 693
 694
 695
 696
 697
 698
 699
 700
 701
 702
 703
 704
 705
 706
 707
 708
 709
 710
 711
 712
 713
 714
 715
 716
 717
 718
 719
 720
 721
 722
 723
 724
 725
 726
 727
 728
 729
 730
 731
 732
 733
 734
 735
 736
 737
 738
 739
 740
 741
 742
 743
 744
 745
 746
 747
 748
 749
 750
 751
 752
 753
 754
 755
 756
 757
 758
 759
 760
 761
 762
 763
 764
 765
 766
 767
 768
 769
 770
 771
 772
 773
 774
 775
 776
 777
 778
 779
 780
 781
 782
 783
 784
 785
 786
 787
 788
 789
 790
 791
 792
 793
 794
 795
 796
 797
 798
 799
 800
 801
 802
 803
 804
 805
 806
 807
 808
 809
 810
 811
 812
 813
 814
 815
 816
 817
 818
 819
 820
 821
 822
 823
 824
 825
 826
 827
 828
 829
 830
 831
 832
 833
 834
 835
 836
 837
 838
 839
 840
 841
 842
 843
 844
 845
 846
 847
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
  [TestFixture]
    public class TestsSample
    {

        [SetUp]
        public void Setup() { }


        [TearDown]
        public void Tear() { }

        [Test]
        public void Pass()
        {
            Console.WriteLine("test1");
            Assert.True(true);
        }

        [Test]
        public void Fail()
        {
            Assert.False(true);
        }

        [Test]
        [Ignore("another time")]
        public void Ignore()
        {
            Assert.True(false);
        }

        [Test]
        public void Inconclusive()
        {
            Assert.Inconclusive("Inconclusive");
        }
    }

```

### Shortcomings of Running these tests

Naturally, you may be thinking how do you now run these tests? Well by default you have to manually run them. This is an app. Starting the tests project in VSis like starting any other Android application - it should deploy the APK to your Android device, and launch the app, which then shows a UI, and you must click various buttons on said UI to run the various tests that you want to run MANUALLY.

### An enormous pain in the ass..

This ofcourse, is a rediculous way forward and we need to get these automated ASAP!

### The short answer

The short answer, is that we need to take a few steps to get these tests automated.. Read on..

### Step 1 - The NuGet Package

I created a NuGet package called [TestyDroid](https://www.nuget.org/packages/Xamarin.TestyDroid/). 

In order to write this tool, it's fair to say it has taken a fair bit of research and testing!

So - [Install the NuGet package to your tests project](https://www.nuget.org/packages/Xamarin.TestyDroid/)

It contains two things. Firstly, it contains a command line executable in it's tools folder, called TestyDroid.exe. This little command line will handle spinning up an emulator, installing your tests apk, and running all of your tests and reporting the results, and lastly terminating the emulator once done.

Secondly, it contains an Android library that is added to your Android tests project as a reference. This library includes an improved base class that you will derive form instead of the default Xamrin one. We will cover this in the next step.

### Step 2

After that is installed, we need to address how these tests get "launched" in the first place.

Android has the concept of "Instrumentation"

`Instrumentation` are basically special types, that can be launched via an intent, and can run tests.

So, in order to "start" the tests running on the Android device (after the APK) has been installed, we need to create this "Instrumentation" class in our tests project. 

Add the following class to your Tests project:

<table class="highlighttable"><tr><td><div class="linenodiv" style="background-color: #f0f0f0; padding-right: 10px"><pre style="line-height: 125%">  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487</pre></div></td><td class="code"><div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%"><span></span><span style="color: #008000; font-weight: bold">namespace</span> <span style="color: #0000FF; font-weight: bold">Xamarin.TestyDroid.TestTests</span>
{
<span style="color: #7D9029">    [Instrumentation(Name = "xamarin.testydroid.testtests.TestInstrumentation")]</span>
    <span style="color: #008000; font-weight: bold">public</span> <span style="color: #008000; font-weight: bold">class</span> <span style="color: #0000FF; font-weight: bold">TestInstrumentation</span> : TestyDroid.Android.TestyDroidTestSuiteInstrumentation
    {   

        <span style="color: #008000; font-weight: bold">public</span> <span style="color: #0000FF">TestInstrumentation</span>(IntPtr handle, JniHandleOwnership transfer) : <span style="color: #008000; font-weight: bold">base</span>(handle, transfer)
        {
        }

        <span style="color: #008000; font-weight: bold">protected</span> <span style="color: #008000; font-weight: bold">override</span> <span style="color: #008000; font-weight: bold">void</span> <span style="color: #0000FF">AddTests</span>()
        {
            AddTest(Assembly.GetExecutingAssembly());
        }
    }

}

<span style="border: 1px solid #FF0000">```</span>

Imortant to <span style="color: #0000FF">note</span> (adjust the Namespace appropriately) - the Instrumentation Attribute above the <span style="color: #008000; font-weight: bold">class</span> <span style="color: #0000FF; font-weight: bold">has</span> a <span style="color: #BA2121">"Name"</span> property. THIS IS VERY IMPORTANT. Make sure it matches yoru <span style="color: #008000; font-weight: bold">namespace</span> <span style="border: 1px solid #FF0000">+ </span><span style="color: #0000FF; font-weight: bold">class</span> name, but with the <span style="color: #008000; font-weight: bold">namespace</span> <span style="color: #0000FF; font-weight: bold">in</span> lower <span style="color: #008000; font-weight: bold">case</span>.

So <span style="color: #008000; font-weight: bold">if</span> you changed the <span style="color: #008000; font-weight: bold">namespace</span> <span style="color: #0000FF; font-weight: bold">of</span> <span style="color: #008000; font-weight: bold">this</span> <span style="color: #008000; font-weight: bold">class</span> <span style="color: #0000FF; font-weight: bold">to</span> MyCoolApp.Tests
And you changed the Class Name of <span style="color: #008000; font-weight: bold">this</span> <span style="color: #008000; font-weight: bold">class</span> <span style="color: #0000FF; font-weight: bold">to</span> MyCoolTestInstrumentation
Then the Attribute above the MyCoolTestInstrumentation <span style="color: #008000; font-weight: bold">class</span> <span style="color: #0000FF; font-weight: bold">should</span> look like <span style="color: #008000; font-weight: bold">this</span>:

<table class=<span style="color: #BA2121">"highlighttable"</span>><tr><td><div class=<span style="color: #BA2121">"linenodiv"</span> style=<span style="color: #BA2121">"background-color: #f0f0f0; padding-right: 10px"</span>><pre style=<span style="color: #BA2121">"line-height: 125%"</span>>  <span style="color: #666666">1</span>
  <span style="color: #666666">2</span>
  <span style="color: #666666">3</span>
  <span style="color: #666666">4</span>
  <span style="color: #666666">5</span>
  <span style="color: #666666">6</span>
  <span style="color: #666666">7</span>
  <span style="color: #666666">8</span>
  <span style="color: #666666">9</span>
 <span style="color: #666666">10</span>
 <span style="color: #666666">11</span>
 <span style="color: #666666">12</span>
 <span style="color: #666666">13</span>
 <span style="color: #666666">14</span>
 <span style="color: #666666">15</span>
 <span style="color: #666666">16</span>
 <span style="color: #666666">17</span>
 <span style="color: #666666">18</span>
 <span style="color: #666666">19</span>
 <span style="color: #666666">20</span>
 <span style="color: #666666">21</span>
 <span style="color: #666666">22</span>
 <span style="color: #666666">23</span>
 <span style="color: #666666">24</span>
 <span style="color: #666666">25</span>
 <span style="color: #666666">26</span>
 <span style="color: #666666">27</span>
 <span style="color: #666666">28</span>
 <span style="color: #666666">29</span>
 <span style="color: #666666">30</span>
 <span style="color: #666666">31</span>
 <span style="color: #666666">32</span>
 <span style="color: #666666">33</span>
 <span style="color: #666666">34</span>
 <span style="color: #666666">35</span>
 <span style="color: #666666">36</span>
 <span style="color: #666666">37</span>
 <span style="color: #666666">38</span>
 <span style="color: #666666">39</span>
 <span style="color: #666666">40</span>
 <span style="color: #666666">41</span>
 <span style="color: #666666">42</span>
 <span style="color: #666666">43</span>
 <span style="color: #666666">44</span>
 <span style="color: #666666">45</span>
 <span style="color: #666666">46</span>
 <span style="color: #666666">47</span>
 <span style="color: #666666">48</span>
 <span style="color: #666666">49</span>
 <span style="color: #666666">50</span>
 <span style="color: #666666">51</span>
 <span style="color: #666666">52</span>
 <span style="color: #666666">53</span>
 <span style="color: #666666">54</span>
 <span style="color: #666666">55</span>
 <span style="color: #666666">56</span>
 <span style="color: #666666">57</span>
 <span style="color: #666666">58</span>
 <span style="color: #666666">59</span>
 <span style="color: #666666">60</span>
 <span style="color: #666666">61</span>
 <span style="color: #666666">62</span>
 <span style="color: #666666">63</span>
 <span style="color: #666666">64</span>
 <span style="color: #666666">65</span>
 <span style="color: #666666">66</span>
 <span style="color: #666666">67</span>
 <span style="color: #666666">68</span>
 <span style="color: #666666">69</span>
 <span style="color: #666666">70</span>
 <span style="color: #666666">71</span>
 <span style="color: #666666">72</span>
 <span style="color: #666666">73</span>
 <span style="color: #666666">74</span>
 <span style="color: #666666">75</span>
 <span style="color: #666666">76</span>
 <span style="color: #666666">77</span>
 <span style="color: #666666">78</span>
 <span style="color: #666666">79</span>
 <span style="color: #666666">80</span>
 <span style="color: #666666">81</span>
 <span style="color: #666666">82</span>
 <span style="color: #666666">83</span>
 <span style="color: #666666">84</span>
 <span style="color: #666666">85</span>
 <span style="color: #666666">86</span>
 <span style="color: #666666">87</span>
 <span style="color: #666666">88</span>
 <span style="color: #666666">89</span>
 <span style="color: #666666">90</span>
 <span style="color: #666666">91</span>
 <span style="color: #666666">92</span>
 <span style="color: #666666">93</span>
 <span style="color: #666666">94</span>
 <span style="color: #666666">95</span>
 <span style="color: #666666">96</span>
 <span style="color: #666666">97</span>
 <span style="color: #666666">98</span>
 <span style="color: #666666">99</span>
<span style="color: #666666">100</span>
<span style="color: #666666">101</span>
<span style="color: #666666">102</span>
<span style="color: #666666">103</span>
<span style="color: #666666">104</span>
<span style="color: #666666">105</span>
<span style="color: #666666">106</span>
<span style="color: #666666">107</span>
<span style="color: #666666">108</span>
<span style="color: #666666">109</span>
<span style="color: #666666">110</span>
<span style="color: #666666">111</span>
<span style="color: #666666">112</span>
<span style="color: #666666">113</span>
<span style="color: #666666">114</span>
<span style="color: #666666">115</span>
<span style="color: #666666">116</span>
<span style="color: #666666">117</span>
<span style="color: #666666">118</span>
<span style="color: #666666">119</span>
<span style="color: #666666">120</span>
<span style="color: #666666">121</span>
<span style="color: #666666">122</span>
<span style="color: #666666">123</span>
<span style="color: #666666">124</span>
<span style="color: #666666">125</span>
<span style="color: #666666">126</span>
<span style="color: #666666">127</span>
<span style="color: #666666">128</span>
<span style="color: #666666">129</span>
<span style="color: #666666">130</span>
<span style="color: #666666">131</span>
<span style="color: #666666">132</span>
<span style="color: #666666">133</span>
<span style="color: #666666">134</span>
<span style="color: #666666">135</span>
<span style="color: #666666">136</span>
<span style="color: #666666">137</span>
<span style="color: #666666">138</span>
<span style="color: #666666">139</span>
<span style="color: #666666">140</span>
<span style="color: #666666">141</span>
<span style="color: #666666">142</span>
<span style="color: #666666">143</span>
<span style="color: #666666">144</span>
<span style="color: #666666">145</span>
<span style="color: #666666">146</span>
<span style="color: #666666">147</span>
<span style="color: #666666">148</span>
<span style="color: #666666">149</span>
<span style="color: #666666">150</span>
<span style="color: #666666">151</span>
<span style="color: #666666">152</span>
<span style="color: #666666">153</span>
<span style="color: #666666">154</span>
<span style="color: #666666">155</span>
<span style="color: #666666">156</span>
<span style="color: #666666">157</span>
<span style="color: #666666">158</span>
<span style="color: #666666">159</span>
<span style="color: #666666">160</span>
<span style="color: #666666">161</span>
<span style="color: #666666">162</span>
<span style="color: #666666">163</span>
<span style="color: #666666">164</span>
<span style="color: #666666">165</span>
<span style="color: #666666">166</span>
<span style="color: #666666">167</span>
<span style="color: #666666">168</span>
<span style="color: #666666">169</span>
<span style="color: #666666">170</span>
<span style="color: #666666">171</span>
<span style="color: #666666">172</span>
<span style="color: #666666">173</span>
<span style="color: #666666">174</span>
<span style="color: #666666">175</span>
<span style="color: #666666">176</span>
<span style="color: #666666">177</span>
<span style="color: #666666">178</span>
<span style="color: #666666">179</span>
<span style="color: #666666">180</span>
<span style="color: #666666">181</span>
<span style="color: #666666">182</span>
<span style="color: #666666">183</span>
<span style="color: #666666">184</span>
<span style="color: #666666">185</span>
<span style="color: #666666">186</span>
<span style="color: #666666">187</span>
<span style="color: #666666">188</span>
<span style="color: #666666">189</span>
<span style="color: #666666">190</span>
<span style="color: #666666">191</span>
<span style="color: #666666">192</span>
<span style="color: #666666">193</span>
<span style="color: #666666">194</span>
<span style="color: #666666">195</span>
<span style="color: #666666">196</span>
<span style="color: #666666">197</span>
<span style="color: #666666">198</span>
<span style="color: #666666">199</span>
<span style="color: #666666">200</span>
<span style="color: #666666">201</span>
<span style="color: #666666">202</span>
<span style="color: #666666">203</span>
<span style="color: #666666">204</span>
<span style="color: #666666">205</span>
<span style="color: #666666">206</span>
<span style="color: #666666">207</span>
<span style="color: #666666">208</span>
<span style="color: #666666">209</span>
<span style="color: #666666">210</span>
<span style="color: #666666">211</span>
<span style="color: #666666">212</span>
<span style="color: #666666">213</span>
<span style="color: #666666">214</span>
<span style="color: #666666">215</span>
<span style="color: #666666">216</span>
<span style="color: #666666">217</span>
<span style="color: #666666">218</span>
<span style="color: #666666">219</span>
<span style="color: #666666">220</span>
<span style="color: #666666">221</span>
<span style="color: #666666">222</span>
<span style="color: #666666">223</span>
<span style="color: #666666">224</span>
<span style="color: #666666">225</span>
<span style="color: #666666">226</span>
<span style="color: #666666">227</span>
<span style="color: #666666">228</span>
<span style="color: #666666">229</span>
<span style="color: #666666">230</span></pre></div></td><td class=<span style="color: #BA2121">"code"</span>><div class=<span style="color: #BA2121">"highlight"</span> style=<span style="color: #BA2121">"background: #f8f8f8"</span>><pre style=<span style="color: #BA2121">"line-height: 125%"</span>><span></span><span style=<span style="color: #BA2121">"color: #7D9029"</span>> [Instrumentation(Name = <span style="color: #BA2121">"mycoolapp.tests.MyCoolTestInstrumentation"</span>)]</span>
    <span style=<span style="color: #BA2121">"color: #008000; font-weight: bold"</span>><span style="color: #008000; font-weight: bold">public</span></span> <span style=<span style="color: #BA2121">"color: #008000; font-weight: bold"</span>>class</span> <span style=<span style="color: #BA2121">"color: #0000FF; font-weight: bold"</span>>MyCoolTestInstrumentation</span> : TestyDroid.Android.TestyDroidTestSuiteInstrumentation
    {   
<span style=<span style="color: #BA2121">"border: 1px solid #FF0000"</span>><span style="border: 1px solid #FF0000">```</span></span>

<span style=<span style="color: #BA2121">"border: 1px solid #FF0000"</span>><span style="border: 1px solid #FF0000">###</span></span> Step <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">3</span></span> - Jot things down

We now need to make a note of a few variables that we will need <span style=<span style="color: #BA2121">"color: #008000; font-weight: bold"</span>><span style="color: #008000; font-weight: bold">in</span></span> order to call <span style=<span style="color: #BA2121">"border: 1px solid #FF0000"</span>><span style="border: 1px solid #FF0000">`</span></span>TestyDroid.exe<span style=<span style="color: #BA2121">"border: 1px solid #FF0000"</span>><span style="border: 1px solid #FF0000">`</span></span> to run our tests. 

The first thing we need <span style=<span style="color: #BA2121">"color: #008000; font-weight: bold"</span>><span style="color: #008000; font-weight: bold">is</span></span> the <span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"class path"</span></span> of your tests Instrumentation. This <span style=<span style="color: #BA2121">"color: #008000; font-weight: bold"</span>><span style="color: #008000; font-weight: bold">is</span></span> <span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"Name"</span></span> <span style=<span style="color: #BA2121">"color: #008000; font-weight: bold"</span>><span style="color: #008000; font-weight: bold">value</span></span> of the [Instrumentation] attribute <span style=<span style="color: #BA2121">"color: #008000; font-weight: bold"</span>><span style="color: #008000; font-weight: bold">in</span></span> the previous step. For example: 

<span style=<span style="color: #BA2121">"border: 1px solid #FF0000"</span>><span style="border: 1px solid #FF0000">`</span></span>xamarin.testydroid.testtests.TestInstrumentation<span style=<span style="color: #BA2121">"border: 1px solid #FF0000"</span>><span style="border: 1px solid #FF0000">`</span></span>

The next thing we need <span style=<span style="color: #BA2121">"color: #008000; font-weight: bold"</span>><span style="color: #008000; font-weight: bold">is</span></span> the Package name of your tests package. This you can grab <span style=<span style="color: #BA2121">"color: #008000; font-weight: bold"</span>><span style="color: #008000; font-weight: bold">from</span></span> the <span style=<span style="color: #BA2121">"border: 1px solid #FF0000"</span>><span style="border: 1px solid #FF0000">`</span></span>AndroidManifest.xml<span style=<span style="color: #BA2121">"border: 1px solid #FF0000"</span>><span style="border: 1px solid #FF0000">`</span></span> file.

Here <span style=<span style="color: #BA2121">"color: #008000; font-weight: bold"</span>><span style="color: #008000; font-weight: bold">is</span></span> mine:

<table class=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"highlighttable"</span></span>><tr><td><div class=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"linenodiv"</span></span> style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"background-color: #f0f0f0; padding-right: 10px"</span></span>><pre style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"line-height: 125%"</span></span>>  <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">1</span></span>
  <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">2</span></span>
  <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">3</span></span>
  <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">4</span></span>
  <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">5</span></span>
  <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">6</span></span>
  <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">7</span></span>
  <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">8</span></span>
  <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">9</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">10</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">11</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">12</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">13</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">14</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">15</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">16</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">17</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">18</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">19</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">20</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">21</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">22</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">23</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">24</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">25</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">26</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">27</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">28</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">29</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">30</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">31</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">32</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">33</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">34</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">35</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">36</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">37</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">38</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">39</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">40</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">41</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">42</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">43</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">44</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">45</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">46</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">47</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">48</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">49</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">50</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">51</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">52</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">53</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">54</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">55</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">56</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">57</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">58</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">59</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">60</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">61</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">62</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">63</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">64</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">65</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">66</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">67</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">68</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">69</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">70</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">71</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">72</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">73</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">74</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">75</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">76</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">77</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">78</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">79</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">80</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">81</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">82</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">83</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">84</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">85</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">86</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">87</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">88</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">89</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">90</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">91</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">92</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">93</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">94</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">95</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">96</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">97</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">98</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">99</span></span>
<span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">100</span></span>
<span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">101</span></span>
<span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">102</span></span>
<span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">103</span></span>
<span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">104</span></span>
<span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">105</span></span>
<span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">106</span></span></pre></div></td><td class=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"code"</span></span>><div class=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"highlight"</span></span> style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"background: #f8f8f8"</span></span>><pre style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"line-height: 125%"</span></span>><span></span><span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #BC7A00"</span></span>><?xml version=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"1.0"</span></span> encoding=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"utf-8"</span></span>?></span>
<span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #008000; font-weight: bold"</span></span>><manifest</span> <span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #7D9029"</span></span>>xmlns:android=</span><span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #BA2121"</span></span>><span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"http://schemas.android.com/apk/res/android"</span></span></span> <span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #7D9029"</span></span>>package=</span><span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #BA2121"</span></span>><span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"Xamarin.TestyDroid.TestTests"</span></span></span> <span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #7D9029"</span></span>>android:versionCode=</span><span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #BA2121"</span></span>><span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"1"</span></span></span> <span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #7D9029"</span></span>>android:versionName=</span><span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #BA2121"</span></span>><span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"1.0"</span></span></span><span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #008000; font-weight: bold"</span></span>>></span>
	<span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #008000; font-weight: bold"</span></span>><uses-sdk</span> <span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #008000; font-weight: bold"</span></span>>/></span>
	<span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #008000; font-weight: bold"</span></span>><application</span> <span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #7D9029"</span></span>>android:label=</span><span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #BA2121"</span></span>><span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"Xamarin.TestyDroid.TestTests"</span></span></span> <span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #7D9029"</span></span>>android:icon=</span><span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #BA2121"</span></span>><span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"@drawable/Icon"</span></span></span><span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #008000; font-weight: bold"</span></span>>></application></span>
<span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #008000; font-weight: bold"</span></span>></manifest></span>
<span style=<span style="color: #BA2121">"border: 1px solid #FF0000"</span>><span style="border: 1px solid #FF0000">```</span></span>

So the package name <span style=<span style="color: #BA2121">"color: #008000; font-weight: bold"</span>><span style="color: #008000; font-weight: bold">for</span></span> my tests app <span style=<span style="color: #BA2121">"color: #008000; font-weight: bold"</span>><span style="color: #008000; font-weight: bold">is</span></span> <span style=<span style="color: #BA2121">"border: 1px solid #FF0000"</span>><span style="border: 1px solid #FF0000">`</span></span>Xamarin.TestyDroid.TestTests<span style=<span style="color: #BA2121">"border: 1px solid #FF0000"</span>><span style="border: 1px solid #FF0000">`</span></span>

You will also need to know some more general paramaters about <span style=<span style="color: #BA2121">"color: #008000; font-weight: bold"</span>><span style="color: #008000; font-weight: bold">where</span></span> things are <span style=<span style="color: #BA2121">"color: #008000; font-weight: bold"</span>><span style="color: #008000; font-weight: bold">on</span></span> our environment:

<span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">1.</span></span> The path to <span style=<span style="color: #BA2121">"border: 1px solid #FF0000"</span>><span style="border: 1px solid #FF0000">`</span></span>Adb.exe<span style=<span style="color: #BA2121">"border: 1px solid #FF0000"</span>><span style="border: 1px solid #FF0000">`</span></span> (<span style=<span style="color: #BA2121">"color: #008000; font-weight: bold"</span>><span style="color: #008000; font-weight: bold">this</span></span> <span style=<span style="color: #BA2121">"color: #008000; font-weight: bold"</span>><span style="color: #008000; font-weight: bold">is</span></span> <span style=<span style="color: #BA2121">"color: #008000; font-weight: bold"</span>><span style="color: #008000; font-weight: bold">in</span></span> your android-sdk<span style=<span style="color: #BA2121">"border: 1px solid #FF0000"</span>><span style="border: 1px solid #FF0000">\</span></span>platform-tools directory)
<span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">2.</span></span> The path to <span style=<span style="color: #BA2121">"border: 1px solid #FF0000"</span>><span style="border: 1px solid #FF0000">`</span></span>Emulator.exe<span style=<span style="color: #BA2121">"border: 1px solid #FF0000"</span>><span style="border: 1px solid #FF0000">`</span></span> (<span style=<span style="color: #BA2121">"color: #008000; font-weight: bold"</span>><span style="color: #008000; font-weight: bold">this</span></span> <span style=<span style="color: #BA2121">"color: #008000; font-weight: bold"</span>><span style="color: #008000; font-weight: bold">is</span></span> <span style=<span style="color: #BA2121">"color: #008000; font-weight: bold"</span>><span style="color: #008000; font-weight: bold">in</span></span> your android-sdk<span style=<span style="color: #BA2121">"border: 1px solid #FF0000"</span>><span style="border: 1px solid #FF0000">\</span></span>tools directory)
<span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">3.</span></span> The path to your Tests APK file (I will give you a clue - it will probably be <span style=<span style="color: #BA2121">"color: #008000; font-weight: bold"</span>><span style="color: #008000; font-weight: bold">in</span></span> your bin/release/ folder of your tests project!)
<span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">4.</span></span> The name of the AVD that you would like to be launched <span style=<span style="color: #BA2121">"color: #008000; font-weight: bold"</span>><span style="color: #008000; font-weight: bold">in</span></span> the emulator and used to run the tests <span style=<span style="color: #BA2121">"color: #008000; font-weight: bold"</span>><span style="color: #008000; font-weight: bold">on</span></span>.

Once you have these things, you are ready to give TestyDroid.exe a whirl!

<span style=<span style="color: #BA2121">"border: 1px solid #FF0000"</span>><span style="border: 1px solid #FF0000">###</span></span> Step <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">4</span></span> - Running things locally.

Armed with the information <span style=<span style="color: #BA2121">"color: #008000; font-weight: bold"</span>><span style="color: #008000; font-weight: bold">in</span></span> the previous step:

<span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">1.</span></span> Open up a command prompt.
<span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">2.</span></span> CD to the tools directory of the Xamarin.TestyDroid nuget package you added to your  earlier. It should be something like <span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"..path to you solution/packages/Xamarin.TestyDroid.x.x.x/tools/"</span></span>
<span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">3.</span></span> Run <span style=<span style="color: #BA2121">"border: 1px solid #FF0000"</span>><span style="border: 1px solid #FF0000">`</span></span>Xamarin.TestyDroid.exe<span style=<span style="color: #BA2121">"border: 1px solid #FF0000"</span>><span style="border: 1px solid #FF0000">`</span></span> with the arguments it needs! Look here <span style=<span style="color: #BA2121">"color: #008000; font-weight: bold"</span>><span style="color: #008000; font-weight: bold">for</span></span> a breakdown of all the arguments: https:<span style=<span style="color: #BA2121">"color: #408080; font-style: italic"</span>><span style="color: #408080; font-style: italic">//github.com/dazinator/Xamarin.TestyDroid - or just execute it with the `--help` argument to see the help screen.</span></span>

Here <span style=<span style="color: #BA2121">"color: #008000; font-weight: bold"</span>><span style="color: #008000; font-weight: bold">is</span></span> an example:

<span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #008000; font-weight: bold"</span></span>><table</span> <span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #7D9029"</span></span>>class=</span><span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #BA2121"</span></span>><span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"highlighttable"</span></span></span><span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #008000; font-weight: bold"</span></span>>><tr><td><div</span> <span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #7D9029"</span></span>>class=</span><span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #BA2121"</span></span>><span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"linenodiv"</span></span></span> <span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #7D9029"</span></span>>style=</span><span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #BA2121"</span></span>><span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"background-color: #f0f0f0; padding-right: 10px"</span></span></span><span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #008000; font-weight: bold"</span></span>>><pre</span> <span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #7D9029"</span></span>>style=</span><span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #BA2121"</span></span>><span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"line-height: 125%"</span></span></span><span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #008000; font-weight: bold"</span></span>>></span><span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">1</span></span><span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #008000; font-weight: bold"</span></span>></pre></div></td><td</span> <span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #7D9029"</span></span>>class=</span><span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #BA2121"</span></span>><span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"code"</span></span></span><span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #008000; font-weight: bold"</span></span>>><div</span> <span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #7D9029"</span></span>>class=</span><span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #BA2121"</span></span>><span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"highlight"</span></span></span> <span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #7D9029"</span></span>>style=</span><span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #BA2121"</span></span>><span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"background: #f8f8f8"</span></span></span><span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #008000; font-weight: bold"</span></span>>><pre</span> <span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #7D9029"</span></span>>style=</span><span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #BA2121"</span></span>><span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"line-height: 125%"</span></span></span><span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #008000; font-weight: bold"</span></span>>><span></span></span>Xamarin.TestyDroid.exe -e <span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #008000; font-weight: bold"</span></span>><span</span> <span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #7D9029"</span></span>>style=</span><span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #BA2121"</span></span>><span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #BA2121"</span></span></span><span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #008000; font-weight: bold"</span></span>>></span><span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"C:\Program Files (x86)\Android\android-sdk\tools\emulator.exe"</span></span><span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #008000; font-weight: bold"</span></span>></span></span> -d <span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #008000; font-weight: bold"</span></span>><span</span> <span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #7D9029"</span></span>>style=</span><span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #BA2121"</span></span>><span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #BA2121"</span></span></span><span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #008000; font-weight: bold"</span></span>>></span><span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe"</span></span><span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #008000; font-weight: bold"</span></span>></span></span> -f <span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #008000; font-weight: bold"</span></span>><span</span> <span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #7D9029"</span></span>>style=</span><span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #BA2121"</span></span>><span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #BA2121"</span></span></span><span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #008000; font-weight: bold"</span></span>>></span><span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"src\MyTests\bin\Release\MyTests.apk-Signed.apk"</span></span><span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #008000; font-weight: bold"</span></span>></span></span> -i <span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #008000; font-weight: bold"</span></span>><span</span> <span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #7D9029"</span></span>>style=</span><span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #BA2121"</span></span>><span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #BA2121"</span></span></span><span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #008000; font-weight: bold"</span></span>>></span><span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"AVD_GalaxyNexus_ToolsForApacheCordova"</span></span><span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #008000; font-weight: bold"</span></span>></span></span> -n <span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #008000; font-weight: bold"</span></span>><span</span> <span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #7D9029"</span></span>>style=</span><span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #BA2121"</span></span>><span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #BA2121"</span></span></span><span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #008000; font-weight: bold"</span></span>>></span><span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"MyTests"</span></span><span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #008000; font-weight: bold"</span></span>></span></span> -c <span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #008000; font-weight: bold"</span></span>><span</span> <span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #7D9029"</span></span>>style=</span><span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #BA2121"</span></span>><span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #BA2121"</span></span></span><span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #008000; font-weight: bold"</span></span>>></span><span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"mytests.TestInstrumentation"</span></span><span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #008000; font-weight: bold"</span></span>></span></span> -w <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">120</span></span>
<span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #008000; font-weight: bold"</span></span>></pre></div></span>
<span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #008000; font-weight: bold"</span></span>></td></tr></table></span>

Substitute the argument values accordingly.

You should see output similar to the following:

<span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #008000; font-weight: bold"</span></span>><table</span> <span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #7D9029"</span></span>>class=</span><span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #BA2121"</span></span>><span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"highlighttable"</span></span></span><span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #008000; font-weight: bold"</span></span>>><tr><td><div</span> <span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #7D9029"</span></span>>class=</span><span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #BA2121"</span></span>><span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"linenodiv"</span></span></span> <span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #7D9029"</span></span>>style=</span><span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #BA2121"</span></span>><span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"background-color: #f0f0f0; padding-right: 10px"</span></span></span><span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #008000; font-weight: bold"</span></span>>><pre</span> <span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #7D9029"</span></span>>style=</span><span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #BA2121"</span></span>><span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"line-height: 125%"</span></span></span><span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #008000; font-weight: bold"</span></span>>></span> <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">1</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">2</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">3</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">4</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">5</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">6</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">7</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">8</span></span>
 <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">9</span></span>
<span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">10</span></span>
<span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">11</span></span>
<span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">12</span></span>
<span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">13</span></span>
<span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">14</span></span>
<span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">15</span></span>
<span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">16</span></span>
<span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">17</span></span>
<span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">18</span></span>
<span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">19</span></span><span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #008000; font-weight: bold"</span></span>></pre></div></td><td</span> <span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #7D9029"</span></span>>class=</span><span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #BA2121"</span></span>><span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"code"</span></span></span><span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #008000; font-weight: bold"</span></span>>><div</span> <span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #7D9029"</span></span>>class=</span><span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #BA2121"</span></span>><span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"highlight"</span></span></span> <span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #7D9029"</span></span>>style=</span><span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #BA2121"</span></span>><span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"background: #f8f8f8"</span></span></span><span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #008000; font-weight: bold"</span></span>>><pre</span> <span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #7D9029"</span></span>>style=</span><span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #BA2121"</span></span>><span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"line-height: 125%"</span></span></span><span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #008000; font-weight: bold"</span></span>>><span></span></span>Starting emulator: D:<span style=<span style="color: #BA2121">"border: 1px solid #FF0000"</span>><span style="border: 1px solid #FF0000">\</span></span>android-sdk<span style=<span style="color: #BA2121">"border: 1px solid #FF0000"</span>><span style="border: 1px solid #FF0000">\</span></span>tools<span style=<span style="color: #BA2121">"border: 1px solid #FF0000"</span>><span style="border: 1px solid #FF0000">\</span></span>emulator.exe -avd Xamarin_Android_API_15 -port <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">5554</span></span> -no-boot-anim -prop emu.uuid=<span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">013</span></span>b8394-db8d-<span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">4224</span></span>-a36f-<span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">889</span></span>ce164f74e

Waiting until: <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">04</span></span>/<span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">11</span></span>/<span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">2015</span></span> <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">19</span></span>:<span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">21</span></span>:<span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">29</span></span> <span style=<span style="color: #BA2121">"color: #008000; font-weight: bold"</span>><span style="color: #008000; font-weight: bold">for</span></span> device to complete boot up..

INSTRUMENTATION_RESULT: passed=<span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">1</span></span>

INSTRUMENTATION_RESULT: skipped=<span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">1</span></span>

INSTRUMENTATION_RESULT: inconclusive=<span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">1</span></span>

INSTRUMENTATION_RESULT: failed=<span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">1</span></span>

INSTRUMENTATION_CODE: <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">0</span></span>

Killing device: emulator-<span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">5554</span></span>
Sending kill command.
OK: killing emulator, bye bye

Emulator killed.
<span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #008000; font-weight: bold"</span></span>></pre></div></span>
<span style=<span style=<span style="color: #BA2121">"color: #BA2121"</span>><span style="color: #BA2121">"color: #008000; font-weight: bold"</span></span>></td></tr></table></span>

<span style=<span style="color: #BA2121">"border: 1px solid #FF0000"</span>><span style="border: 1px solid #FF0000">###</span></span> Step <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">5</span></span> - Running On Team City

Once you have verified you can automate the tests locally, the next step <span style=<span style="color: #BA2121">"color: #008000; font-weight: bold"</span>><span style="color: #008000; font-weight: bold">is</span></span> to <span style=<span style="color: #BA2121">"color: #008000; font-weight: bold"</span>><span style="color: #008000; font-weight: bold">set</span></span> up your build system to run them during your build!

TestyDroid additionally supports reporting Test results <span style=<span style="color: #BA2121">"color: #008000; font-weight: bold"</span>><span style="color: #008000; font-weight: bold">in</span></span> a TeamCity format so that they show up <span style=<span style="color: #BA2121">"color: #008000; font-weight: bold"</span>><span style="color: #008000; font-weight: bold">as</span></span> test results <span style=<span style="color: #BA2121">"color: #008000; font-weight: bold"</span>><span style="color: #008000; font-weight: bold">in</span></span> the TeamCity ui - <span style=<span style="color: #BA2121">"color: #008000; font-weight: bold"</span>><span style="color: #008000; font-weight: bold">if</span></span> that<span style=<span style="color: #BA2121">"border: 1px solid #FF0000"</span>><span style="border: 1px solid #FF0000">'</span></span>s your build system.  

To configure TeamCity it<span style=<span style="color: #BA2121">"border: 1px solid #FF0000"</span>><span style="border: 1px solid #FF0000">'</span></span>s a <span style=<span style="color: #BA2121">"color: #008000; font-weight: bold"</span>><span style="color: #008000; font-weight: bold">case</span></span> of:

<span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">1.</span></span> An MSBUILD step to build your Tests project (csproj file) such that it outputs the APK (remember to use the target <span style=<span style="color: #BA2121">"border: 1px solid #FF0000"</span>><span style="border: 1px solid #FF0000">`</span></span>SignAndroidPackage<span style=<span style="color: #BA2121">"border: 1px solid #FF0000"</span>><span style="border: 1px solid #FF0000">`</span></span> to have the APK produced)
<span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">2.</span></span> A command line step that calls <span style=<span style="color: #BA2121">"color: #008000; font-weight: bold"</span>><span style="color: #008000; font-weight: bold">out</span></span> to Xamarin.TestyDroid.exe with the necessary arguments. 

The first step <span style=<span style="color: #BA2121">"color: #008000; font-weight: bold"</span>><span style="color: #008000; font-weight: bold">is</span></span> easy, but the important thing to remember <span style=<span style="color: #BA2121">"color: #008000; font-weight: bold"</span>><span style="color: #008000; font-weight: bold">is</span></span> to <span style=<span style="color: #BA2121">"color: #008000; font-weight: bold"</span>><span style="color: #008000; font-weight: bold">set</span></span> the target to SignAndroidPackage

![tc commandlineparams testydroid.PNG](/img/tc commandlineparams testydroid.PNG)

That will now take care of producing the APK <span style=<span style="color: #BA2121">"color: #008000; font-weight: bold"</span>><span style="color: #008000; font-weight: bold">in</span></span> the output directory <span style=<span style="color: #BA2121">"color: #008000; font-weight: bold"</span>><span style="color: #008000; font-weight: bold">for</span></span> your project during your team city build.

The second step to create <span style=<span style="color: #BA2121">"color: #008000; font-weight: bold"</span>><span style="color: #008000; font-weight: bold">is</span></span> the one that actually runs the tests <span style=<span style="color: #BA2121">"color: #008000; font-weight: bold"</span>>using</span> <span style=<span style="color: #BA2121">"color: #0000FF; font-weight: bold"</span>>TestyDroid</span>!
The follwing screenshot shows setting up a Command line step to <span style=<span style="color: #BA2121">"color: #008000; font-weight: bold"</span>><span style="color: #008000; font-weight: bold">do</span></span> <span style=<span style="color: #BA2121">"color: #008000; font-weight: bold"</span>><span style="color: #008000; font-weight: bold">this</span></span>:
![tc testydroid commandlinestep.PNG](/img/tc testydroid commandlinestep.PNG)

<span style=<span style="color: #BA2121">"border: 1px solid #FF0000"</span>><span style="border: 1px solid #FF0000">###</span></span> Step <span style=<span style="color: #BA2121">"color: #666666"</span>><span style="color: #666666">6</span></span> - Admire your tests <span style=<span style="color: #BA2121">"color: #008000; font-weight: bold"</span>><span style="color: #008000; font-weight: bold">in</span></span> Team City.
Now you can run a build - and <span style=<span style="color: #BA2121">"color: #008000; font-weight: bold"</span>><span style="color: #008000; font-weight: bold">if</span></span> all <span style=<span style="color: #BA2121">"color: #008000; font-weight: bold"</span>><span style="color: #008000; font-weight: bold">is</span></span> well - you should see your tests results added to a tests tab <span style=<span style="color: #BA2121">"color: #008000; font-weight: bold"</span>><span style="color: #008000; font-weight: bold">in</span></span> Team City.

![tc Tests Tab.PNG](/img/tc Tests Tab.PNG)

<span style=<span style="color: #BA2121">"border: 1px solid #FF0000"</span>><span style="border: 1px solid #FF0000">###</span></span> Any Questions?
I have been someone limited <span style=<span style="color: #BA2121">"color: #008000; font-weight: bold"</span>><span style="color: #008000; font-weight: bold">by</span></span> time so <span style=<span style="color: #BA2121">"color: #008000; font-weight: bold"</span>><span style="color: #008000; font-weight: bold">this</span></span> was fairly rushed together! If there <span style=<span style="color: #BA2121">"color: #008000; font-weight: bold"</span>><span style="color: #008000; font-weight: bold">is</span></span> anything you would like me to elaborate <span style=<span style="color: #BA2121">"color: #008000; font-weight: bold"</span>><span style="color: #008000; font-weight: bold">on</span></span>, please leave a comment below.

Also you can read more information about TestyDroid <span style=<span style="color: #BA2121">"color: #008000; font-weight: bold"</span>><span style="color: #008000; font-weight: bold">on</span></span> Github: https:<span style=<span style="color: #BA2121">"color: #408080; font-style: italic"</span>><span style="color: #408080; font-style: italic">//github.com/dazinator/Xamarin.TestyDroid/wiki/Getting-Started</span></span>
</pre></div>
</td></tr></table>
</pre></div>
</td></tr></table>
</pre></div>
</td></tr></table>
comments powered by Disqus