Fix extracting of app_path for iOS coverage

For XCTests there will be more than 2 arguments, therefore
we need to take second argument, not the last one.

Change-Id: Ie3bcac032d49e5e75812dcf7bd248e550c73a244
Reviewed-on: https://chromium-review.googlesource.com/c/1317856
Reviewed-by: Yuke Liao <[email protected]>
Commit-Queue: Artem Titarenko <[email protected]>
Cr-Commit-Position: refs/heads/master@{#606075}
diff --git a/tools/code_coverage/coverage.py b/tools/code_coverage/coverage.py
index d4645a5..e0ca15e 100755
--- a/tools/code_coverage/coverage.py
+++ b/tools/code_coverage/coverage.py
@@ -661,7 +661,7 @@
   if _IsIOSCommand(command):
     # For a given application bundle, the binary resides in the bundle and has
     # the same name with the application without the .app extension.
-    app_path = command_parts[-1].rstrip(os.path.sep)
+    app_path = command_parts[1].rstrip(os.path.sep)
     app_name = os.path.splitext(os.path.basename(app_path))[0]
     return os.path.join(app_path, app_name)