Add --temp flag to preserve compilation artifacts.

Change-Id: I5094fedacfe6c306ffe6293058b8b1fa49e62b04
diff --git a/tools/run_on_app_dump.py b/tools/run_on_app_dump.py
index f71a314..6c25a4d 100755
--- a/tools/run_on_app_dump.py
+++ b/tools/run_on_app_dump.py
@@ -945,6 +945,9 @@
   result.add_argument('--shrinker',
                       help='The shrinkers to use (by default, all are run)',
                       action='append')
+  result.add_argument('--temp',
+                      help='A directory to use for temporaries and outputs.',
+                      default=None)
   result.add_argument('--version',
                       default='main',
                       help='The version of R8 to use (e.g., 1.4.51)')
@@ -1087,6 +1090,8 @@
     return 0
 
   with utils.TempDir() as temp_dir:
+    if options.temp:
+      temp_dir = options.temp
     if options.hash:
       # Download r8-<hash>.jar from
       # https://storage.googleapis.com/r8-releases/raw/.