Testing the card agent code is somewhat tricky and requires a running card applet as well as the running CardAgentTesterApp mobile device project. This section will show you how to configure both of these dependencies to do real-time debugging of the card agent code. After you are done developing and testing your card applet, it is fairly simple to get the applet running in your test environment. Here is an example of doing that with the Mobile SDK. From the command line of the issuer SDK directory: > gradlew build Then run the card applet simulator, but do not connect to it with a shell: > bin\cardsim.bat -i noshell This will block and return: # SimplyTapp simulator running on port 3000 Then open a new command line in the issuer SDK directory so you can install the applets in the running card simulator: > bin\gpj.bat <CardApplets\test.jcsh response: Found card in terminal: SimplyTapp ATR: 3B 00 >>ATR: 3B 00 Command APDU: 00 A4 04 00 07 A0 00 00 01 51 00 00 Response APDU: 6F 0F 84 08 A0 00 00 01 51 00 00 A5 04 9F 65 01 FF 90 00 (6 ms) Successfully selected Security Domain GP211 A0 00 00 01 51 00 00 >>Command APDU: 80 50 00 00 08 C7 A9 9F B7 E8 2A 01 2B Response APDU: 00 00 00 00 00 00 00 00 00 00 FF 02 00 03 5D CA B0 2A 0E 3D F0 1B 29 2E 8D DE 79 D0 90 00 (7 ms) Command APDU: 84 82 00 00 10 45 2D 8D 5B 2F DF 44 8D 4F 78 4F 00 E3 CC 06 68 Response APDU: 90 00 (6 ms) >>Command APDU: 80 E6 0C 00 2C 06 63 6F 6D 2E 73 74 08 50 70 73 65 32 50 61 79 0E 32 50 41 59 2E 53 59 53 2E 44 44 46 30 31 01 00 09 C9 07 A0 00 00 00 03 10 10 00 Response APDU: 6A 88 (5 ms) command not supported >>Command APDU: 80 E6 0C 00 20 06 63 6F 6D 2E 73 74 0A 43 61 72 64 41 70 70 6C 65 74 07 A0 00 00 00 03 10 10 01 00 02 C9 00 00 Response APDU: 6A 88 (7 ms) command not supported >>Command APDU: 00 A4 04 00 0E 32 50 41 59 2E 53 59 53 2E 44 44 46 30 31 Response APDU: 6F 23 84 0E 32 50 41 59 2E 53 59 53 2E 44 44 46 30 31 A5 11 BF 0C 0E 61 0C 4F 07 A0 00 00 00 03 10 10 87 01 01 90 00 (6 ms) >Command APDU: 00 A4 04 00 07 A0 00 00 00 03 10 10 Response APDU: 90 00 (6 ms) >ATR: 3B 00 > At this point the card simulator is left running on the local port 3000 with the example applets installed and is able to be selected in the card manager. The CardAgentTesterApp mobile application can now successfully connect to this ip-address and port as it would a remote card. Configuring and Running CardAgentTesterAppThis android mobile application is meant to load a card agent class and connect to a card simulator in order to do full testing on the card agent class. Make sure that the card agent class that is meant to be loaded is contained within the .apk as an export. Prior to building the application and testing it, you will need to change the configuration in com.simplytapp.config.Constants.java: final public static String ip="192.168.0.102"; //address of a running SE simulator final public static int port=3000; //port address of a running SE simulator Set the configuration above to the ip-address of the computer running the card simulator and the port it is running on. Once you have changed the configuration you will be able to debug or run the mobile application. If the mobile application launches and shows a card on the main screen, then your card agent was successfully loaded into the application. If the card agent attempts to connect and transceive with a remote card, the card simulator will service those calls. On to Install and Test Applet with Cloud SE |
Issuer >