Am.java revision 2d1b7a22390a355aa079473810e2b9914af88274
1/*
2**
3** Copyright 2007, The Android Open Source Project
4**
5** Licensed under the Apache License, Version 2.0 (the "License");
6** you may not use this file except in compliance with the License.
7** You may obtain a copy of the License at
8**
9**     http://www.apache.org/licenses/LICENSE-2.0
10**
11** Unless required by applicable law or agreed to in writing, software
12** distributed under the License is distributed on an "AS IS" BASIS,
13** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14** See the License for the specific language governing permissions and
15** limitations under the License.
16*/
17
18
19package com.android.commands.am;
20
21import android.app.ActivityManagerNative;
22import android.app.IActivityManager;
23import android.app.IInstrumentationWatcher;
24import android.app.Instrumentation;
25import android.content.ComponentName;
26import android.content.IIntentReceiver;
27import android.content.Intent;
28import android.net.Uri;
29import android.os.Bundle;
30import android.os.ParcelFileDescriptor;
31import android.os.ServiceManager;
32import android.util.AndroidException;
33import android.view.IWindowManager;
34
35import java.io.File;
36import java.io.FileNotFoundException;
37import java.io.PrintStream;
38import java.net.URISyntaxException;
39import java.util.Iterator;
40import java.util.Set;
41
42public class Am {
43
44    private IActivityManager mAm;
45    private String[] mArgs;
46    private int mNextArg;
47    private String mCurArgData;
48
49    private boolean mDebugOption = false;
50    private boolean mWaitOption = false;
51
52    // These are magic strings understood by the Eclipse plugin.
53    private static final String FATAL_ERROR_CODE = "Error type 1";
54    private static final String NO_SYSTEM_ERROR_CODE = "Error type 2";
55    private static final String NO_CLASS_ERROR_CODE = "Error type 3";
56
57    /**
58     * Command-line entry point.
59     *
60     * @param args The command-line arguments
61     */
62    public static void main(String[] args) {
63        try {
64            (new Am()).run(args);
65        } catch (IllegalArgumentException e) {
66            showUsage();
67            System.err.println("Error: " + e.getMessage());
68        } catch (Exception e) {
69            System.err.println(e.toString());
70            System.exit(1);
71        }
72    }
73
74    private void run(String[] args) throws Exception {
75        if (args.length < 1) {
76            showUsage();
77            return;
78        }
79
80        mAm = ActivityManagerNative.getDefault();
81        if (mAm == null) {
82            System.err.println(NO_SYSTEM_ERROR_CODE);
83            throw new AndroidException("Can't connect to activity manager; is the system running?");
84        }
85
86        mArgs = args;
87        String op = args[0];
88        mNextArg = 1;
89
90        if (op.equals("start")) {
91            runStart();
92        } else if (op.equals("startservice")) {
93            runStartService();
94        } else if (op.equals("instrument")) {
95            runInstrument();
96        } else if (op.equals("broadcast")) {
97            sendBroadcast();
98        } else if (op.equals("profile")) {
99            runProfile();
100        } else if (op.equals("dumpheap")) {
101            runDumpHeap();
102        } else {
103            throw new IllegalArgumentException("Unknown command: " + op);
104        }
105    }
106
107    private Intent makeIntent() throws URISyntaxException {
108        Intent intent = new Intent();
109        boolean hasIntentInfo = false;
110
111        mDebugOption = false;
112        mWaitOption = false;
113        Uri data = null;
114        String type = null;
115
116        String opt;
117        while ((opt=nextOption()) != null) {
118            if (opt.equals("-a")) {
119                intent.setAction(nextArgRequired());
120                hasIntentInfo = true;
121            } else if (opt.equals("-d")) {
122                data = Uri.parse(nextArgRequired());
123                hasIntentInfo = true;
124            } else if (opt.equals("-t")) {
125                type = nextArgRequired();
126                hasIntentInfo = true;
127            } else if (opt.equals("-c")) {
128                intent.addCategory(nextArgRequired());
129                hasIntentInfo = true;
130            } else if (opt.equals("-e") || opt.equals("--es")) {
131                String key = nextArgRequired();
132                String value = nextArgRequired();
133                intent.putExtra(key, value);
134                hasIntentInfo = true;
135            } else if (opt.equals("--esn")) {
136                String key = nextArgRequired();
137                intent.putExtra(key, (String) null);
138                hasIntentInfo = true;
139            } else if (opt.equals("--ei")) {
140                String key = nextArgRequired();
141                String value = nextArgRequired();
142                intent.putExtra(key, Integer.valueOf(value));
143                hasIntentInfo = true;
144            } else if (opt.equals("--eia")) {
145                String key = nextArgRequired();
146                String value = nextArgRequired();
147                String[] strings = value.split(",");
148                int[] list = new int[strings.length];
149                for (int i = 0; i < strings.length; i++) {
150                    list[i] = Integer.valueOf(strings[i]);
151                }
152                intent.putExtra(key, list);
153                hasIntentInfo = true;
154            } else if (opt.equals("--el")) {
155                String key = nextArgRequired();
156                String value = nextArgRequired();
157                intent.putExtra(key, Long.valueOf(value));
158                hasIntentInfo = true;
159            } else if (opt.equals("--ela")) {
160                String key = nextArgRequired();
161                String value = nextArgRequired();
162                String[] strings = value.split(",");
163                long[] list = new long[strings.length];
164                for (int i = 0; i < strings.length; i++) {
165                    list[i] = Long.valueOf(strings[i]);
166                }
167                intent.putExtra(key, list);
168                hasIntentInfo = true;
169            } else if (opt.equals("--ez")) {
170                String key = nextArgRequired();
171                String value = nextArgRequired();
172                intent.putExtra(key, Boolean.valueOf(value));
173                hasIntentInfo = true;
174            } else if (opt.equals("-n")) {
175                String str = nextArgRequired();
176                ComponentName cn = ComponentName.unflattenFromString(str);
177                if (cn == null) throw new IllegalArgumentException("Bad component name: " + str);
178                intent.setComponent(cn);
179                hasIntentInfo = true;
180            } else if (opt.equals("-f")) {
181                String str = nextArgRequired();
182                intent.setFlags(Integer.decode(str).intValue());
183            } else if (opt.equals("--grant-read-uri-permission")) {
184                intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
185            } else if (opt.equals("--grant-write-uri-permission")) {
186                intent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
187            } else if (opt.equals("--debug-log-resolution")) {
188                intent.addFlags(Intent.FLAG_DEBUG_LOG_RESOLUTION);
189            } else if (opt.equals("--activity-brought-to-front")) {
190                intent.addFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT);
191            } else if (opt.equals("--activity-clear-top")) {
192                intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
193            } else if (opt.equals("--activity-clear-when-task-reset")) {
194                intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
195            } else if (opt.equals("--activity-exclude-from-recents")) {
196                intent.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
197            } else if (opt.equals("--activity-launched-from-history")) {
198                intent.addFlags(Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY);
199            } else if (opt.equals("--activity-multiple-task")) {
200                intent.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
201            } else if (opt.equals("--activity-no-animation")) {
202                intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
203            } else if (opt.equals("--activity-no-history")) {
204                intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
205            } else if (opt.equals("--activity-no-user-action")) {
206                intent.addFlags(Intent.FLAG_ACTIVITY_NO_USER_ACTION);
207            } else if (opt.equals("--activity-previous-is-top")) {
208                intent.addFlags(Intent.FLAG_ACTIVITY_PREVIOUS_IS_TOP);
209            } else if (opt.equals("--activity-reorder-to-front")) {
210                intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
211            } else if (opt.equals("--activity-reset-task-if-needed")) {
212                intent.addFlags(Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
213            } else if (opt.equals("--activity-single-top")) {
214                intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
215            } else if (opt.equals("--receiver-registered-only")) {
216                intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY);
217            } else if (opt.equals("--receiver-replace-pending")) {
218                intent.addFlags(Intent.FLAG_RECEIVER_REPLACE_PENDING);
219            } else if (opt.equals("-D")) {
220                mDebugOption = true;
221            } else if (opt.equals("-W")) {
222                mWaitOption = true;
223            } else {
224                System.err.println("Error: Unknown option: " + opt);
225                showUsage();
226                return null;
227            }
228        }
229        intent.setDataAndType(data, type);
230
231        String uri = nextArg();
232        if (uri != null) {
233            Intent oldIntent = intent;
234            intent = Intent.parseUri(uri, 0);
235            if (oldIntent.getAction() != null) {
236                intent.setAction(oldIntent.getAction());
237            }
238            if (oldIntent.getData() != null || oldIntent.getType() != null) {
239                intent.setDataAndType(oldIntent.getData(), oldIntent.getType());
240            }
241            Set cats = oldIntent.getCategories();
242            if (cats != null) {
243                Iterator it = cats.iterator();
244                while (it.hasNext()) {
245                    intent.addCategory((String)it.next());
246                }
247            }
248            hasIntentInfo = true;
249        }
250
251        if (!hasIntentInfo) throw new IllegalArgumentException("No intent supplied");
252        return intent;
253    }
254
255    private void runStartService() throws Exception {
256        Intent intent = makeIntent();
257        System.out.println("Starting service: " + intent);
258        ComponentName cn = mAm.startService(null, intent, intent.getType());
259        if (cn == null) {
260            System.err.println("Error: Not found; no service started.");
261        }
262    }
263
264    private void runStart() throws Exception {
265        Intent intent = makeIntent();
266        System.out.println("Starting: " + intent);
267        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
268        // XXX should do something to determine the MIME type.
269        IActivityManager.WaitResult result = null;
270        int res;
271        if (mWaitOption) {
272            result = mAm.startActivityAndWait(null, intent, intent.getType(),
273                        null, 0, null, null, 0, false, mDebugOption);
274            res = result.result;
275        } else {
276            res = mAm.startActivity(null, intent, intent.getType(),
277                    null, 0, null, null, 0, false, mDebugOption);
278        }
279        PrintStream out = mWaitOption ? System.out : System.err;
280        boolean launched = false;
281        switch (res) {
282            case IActivityManager.START_SUCCESS:
283                launched = true;
284                break;
285            case IActivityManager.START_SWITCHES_CANCELED:
286                launched = true;
287                out.println(
288                        "Warning: Activity not started because the "
289                        + " current activity is being kept for the user.");
290                break;
291            case IActivityManager.START_DELIVERED_TO_TOP:
292                launched = true;
293                out.println(
294                        "Warning: Activity not started, intent has "
295                        + "been delivered to currently running "
296                        + "top-most instance.");
297                break;
298            case IActivityManager.START_RETURN_INTENT_TO_CALLER:
299                launched = true;
300                out.println(
301                        "Warning: Activity not started because intent "
302                        + "should be handled by the caller");
303                break;
304            case IActivityManager.START_TASK_TO_FRONT:
305                launched = true;
306                out.println(
307                        "Warning: Activity not started, its current "
308                        + "task has been brought to the front");
309                break;
310            case IActivityManager.START_INTENT_NOT_RESOLVED:
311                out.println(
312                        "Error: Activity not started, unable to "
313                        + "resolve " + intent.toString());
314                break;
315            case IActivityManager.START_CLASS_NOT_FOUND:
316                out.println(NO_CLASS_ERROR_CODE);
317                out.println("Error: Activity class " +
318                        intent.getComponent().toShortString()
319                        + " does not exist.");
320                break;
321            case IActivityManager.START_FORWARD_AND_REQUEST_CONFLICT:
322                out.println(
323                        "Error: Activity not started, you requested to "
324                        + "both forward and receive its result");
325                break;
326            case IActivityManager.START_PERMISSION_DENIED:
327                out.println(
328                        "Error: Activity not started, you do not "
329                        + "have permission to access it.");
330                break;
331            default:
332                out.println(
333                        "Error: Activity not started, unknown error code " + res);
334                break;
335        }
336        if (mWaitOption && launched) {
337            if (result == null) {
338                result = new IActivityManager.WaitResult();
339                result.who = intent.getComponent();
340            }
341            System.out.println("Status: " + (result.timeout ? "timeout" : "ok"));
342            if (result.who != null) {
343                System.out.println("Activity: " + result.who.flattenToShortString());
344            }
345            if (result.thisTime >= 0) {
346                System.out.println("ThisTime: " + result.thisTime);
347            }
348            if (result.totalTime >= 0) {
349                System.out.println("TotalTime: " + result.totalTime);
350            }
351            System.out.println("Complete");
352        }
353    }
354
355    private void sendBroadcast() throws Exception {
356        Intent intent = makeIntent();
357        IntentReceiver receiver = new IntentReceiver();
358        System.out.println("Broadcasting: " + intent);
359        mAm.broadcastIntent(null, intent, null, receiver, 0, null, null, null, true, false);
360        receiver.waitForFinish();
361    }
362
363    private void runInstrument() throws Exception {
364        String profileFile = null;
365        boolean wait = false;
366        boolean rawMode = false;
367        boolean no_window_animation = false;
368        Bundle args = new Bundle();
369        String argKey = null, argValue = null;
370        IWindowManager wm = IWindowManager.Stub.asInterface(ServiceManager.getService("window"));
371
372        String opt;
373        while ((opt=nextOption()) != null) {
374            if (opt.equals("-p")) {
375                profileFile = nextArgRequired();
376            } else if (opt.equals("-w")) {
377                wait = true;
378            } else if (opt.equals("-r")) {
379                rawMode = true;
380            } else if (opt.equals("-e")) {
381                argKey = nextArgRequired();
382                argValue = nextArgRequired();
383                args.putString(argKey, argValue);
384            } else if (opt.equals("--no_window_animation")) {
385                no_window_animation = true;
386            } else {
387                System.err.println("Error: Unknown option: " + opt);
388                showUsage();
389                return;
390            }
391        }
392
393        String cnArg = nextArgRequired();
394        ComponentName cn = ComponentName.unflattenFromString(cnArg);
395        if (cn == null) throw new IllegalArgumentException("Bad component name: " + cnArg);
396
397        InstrumentationWatcher watcher = null;
398        if (wait) {
399            watcher = new InstrumentationWatcher();
400            watcher.setRawOutput(rawMode);
401        }
402        float[] oldAnims = null;
403        if (no_window_animation) {
404            oldAnims = wm.getAnimationScales();
405            wm.setAnimationScale(0, 0.0f);
406            wm.setAnimationScale(1, 0.0f);
407        }
408
409        if (!mAm.startInstrumentation(cn, profileFile, 0, args, watcher)) {
410            throw new AndroidException("INSTRUMENTATION_FAILED: " + cn.flattenToString());
411        }
412
413        if (watcher != null) {
414            if (!watcher.waitForFinish()) {
415                System.out.println("INSTRUMENTATION_ABORTED: System has crashed.");
416            }
417        }
418
419        if (oldAnims != null) {
420            wm.setAnimationScales(oldAnims);
421        }
422    }
423
424    private void runProfile() throws Exception {
425        String profileFile = null;
426        boolean start = false;
427        String process = nextArgRequired();
428        ParcelFileDescriptor fd = null;
429
430        String cmd = nextArgRequired();
431        if ("start".equals(cmd)) {
432            start = true;
433            profileFile = nextArgRequired();
434            try {
435                fd = ParcelFileDescriptor.open(
436                        new File(profileFile),
437                        ParcelFileDescriptor.MODE_CREATE |
438                        ParcelFileDescriptor.MODE_TRUNCATE |
439                        ParcelFileDescriptor.MODE_READ_WRITE);
440            } catch (FileNotFoundException e) {
441                System.err.println("Error: Unable to open file: " + profileFile);
442                return;
443            }
444        } else if (!"stop".equals(cmd)) {
445            throw new IllegalArgumentException("Profile command " + cmd + " not valid");
446        }
447
448        if (!mAm.profileControl(process, start, profileFile, fd)) {
449            throw new AndroidException("PROFILE FAILED on process " + process);
450        }
451    }
452
453    private void runDumpHeap() throws Exception {
454        boolean managed = !"-n".equals(nextOption());
455        String process = nextArgRequired();
456        String heapFile = nextArgRequired();
457        ParcelFileDescriptor fd = null;
458
459        try {
460            fd = ParcelFileDescriptor.open(
461                    new File(heapFile),
462                    ParcelFileDescriptor.MODE_CREATE |
463                    ParcelFileDescriptor.MODE_TRUNCATE |
464                    ParcelFileDescriptor.MODE_READ_WRITE);
465        } catch (FileNotFoundException e) {
466            System.err.println("Error: Unable to open file: " + heapFile);
467            return;
468        }
469
470        if (!mAm.dumpHeap(process, managed, heapFile, fd)) {
471            throw new AndroidException("HEAP DUMP FAILED on process " + process);
472        }
473    }
474
475    private class IntentReceiver extends IIntentReceiver.Stub {
476        private boolean mFinished = false;
477
478        public synchronized void performReceive(
479                Intent intent, int rc, String data, Bundle ext, boolean ord,
480                boolean sticky) {
481            String line = "Broadcast completed: result=" + rc;
482            if (data != null) line = line + ", data=\"" + data + "\"";
483            if (ext != null) line = line + ", extras: " + ext;
484            System.out.println(line);
485            mFinished = true;
486            notifyAll();
487        }
488
489        public synchronized void waitForFinish() {
490            try {
491                while (!mFinished) wait();
492            } catch (InterruptedException e) {
493                throw new IllegalStateException(e);
494            }
495        }
496    }
497
498    private class InstrumentationWatcher extends IInstrumentationWatcher.Stub {
499        private boolean mFinished = false;
500        private boolean mRawMode = false;
501
502        /**
503         * Set or reset "raw mode".  In "raw mode", all bundles are dumped.  In "pretty mode",
504         * if a bundle includes Instrumentation.REPORT_KEY_STREAMRESULT, just print that.
505         * @param rawMode true for raw mode, false for pretty mode.
506         */
507        public void setRawOutput(boolean rawMode) {
508            mRawMode = rawMode;
509        }
510
511        public void instrumentationStatus(ComponentName name, int resultCode, Bundle results) {
512            synchronized (this) {
513                // pretty printer mode?
514                String pretty = null;
515                if (!mRawMode && results != null) {
516                    pretty = results.getString(Instrumentation.REPORT_KEY_STREAMRESULT);
517                }
518                if (pretty != null) {
519                    System.out.print(pretty);
520                } else {
521                    if (results != null) {
522                        for (String key : results.keySet()) {
523                            System.out.println(
524                                    "INSTRUMENTATION_STATUS: " + key + "=" + results.get(key));
525                        }
526                    }
527                    System.out.println("INSTRUMENTATION_STATUS_CODE: " + resultCode);
528                }
529                notifyAll();
530            }
531        }
532
533        public void instrumentationFinished(ComponentName name, int resultCode,
534                Bundle results) {
535            synchronized (this) {
536                // pretty printer mode?
537                String pretty = null;
538                if (!mRawMode && results != null) {
539                    pretty = results.getString(Instrumentation.REPORT_KEY_STREAMRESULT);
540                }
541                if (pretty != null) {
542                    System.out.println(pretty);
543                } else {
544                    if (results != null) {
545                        for (String key : results.keySet()) {
546                            System.out.println(
547                                    "INSTRUMENTATION_RESULT: " + key + "=" + results.get(key));
548                        }
549                    }
550                    System.out.println("INSTRUMENTATION_CODE: " + resultCode);
551                }
552                mFinished = true;
553                notifyAll();
554            }
555        }
556
557        public boolean waitForFinish() {
558            synchronized (this) {
559                while (!mFinished) {
560                    try {
561                        if (!mAm.asBinder().pingBinder()) {
562                            return false;
563                        }
564                        wait(1000);
565                    } catch (InterruptedException e) {
566                        throw new IllegalStateException(e);
567                    }
568                }
569            }
570            return true;
571        }
572    }
573
574    private String nextOption() {
575        if (mCurArgData != null) {
576            String prev = mArgs[mNextArg - 1];
577            throw new IllegalArgumentException("No argument expected after \"" + prev + "\"");
578        }
579        if (mNextArg >= mArgs.length) {
580            return null;
581        }
582        String arg = mArgs[mNextArg];
583        if (!arg.startsWith("-")) {
584            return null;
585        }
586        mNextArg++;
587        if (arg.equals("--")) {
588            return null;
589        }
590        if (arg.length() > 1 && arg.charAt(1) != '-') {
591            if (arg.length() > 2) {
592                mCurArgData = arg.substring(2);
593                return arg.substring(0, 2);
594            } else {
595                mCurArgData = null;
596                return arg;
597            }
598        }
599        mCurArgData = null;
600        return arg;
601    }
602
603    private String nextArg() {
604        if (mCurArgData != null) {
605            String arg = mCurArgData;
606            mCurArgData = null;
607            return arg;
608        } else if (mNextArg < mArgs.length) {
609            return mArgs[mNextArg++];
610        } else {
611            return null;
612        }
613    }
614
615    private String nextArgRequired() {
616        String arg = nextArg();
617        if (arg == null) {
618            String prev = mArgs[mNextArg - 1];
619            throw new IllegalArgumentException("Argument expected after \"" + prev + "\"");
620        }
621        return arg;
622    }
623
624    private static void showUsage() {
625        System.err.println(
626                "usage: am [subcommand] [options]\n" +
627                "\n" +
628                "    start an Activity: am start [-D] [-W] <INTENT>\n" +
629                "        -D: enable debugging\n" +
630                "        -W: wait for launch to complete\n" +
631                "\n" +
632                "    start a Service: am startservice <INTENT>\n" +
633                "\n" +
634                "    send a broadcast Intent: am broadcast <INTENT>\n" +
635                "\n" +
636                "    start an Instrumentation: am instrument [flags] <COMPONENT>\n" +
637                "        -r: print raw results (otherwise decode REPORT_KEY_STREAMRESULT)\n" +
638                "        -e <NAME> <VALUE>: set argument <NAME> to <VALUE>\n" +
639                "        -p <FILE>: write profiling data to <FILE>\n" +
640                "        -w: wait for instrumentation to finish before returning\n" +
641                "\n" +
642                "    run a test package against an application: am instrument [flags] <TEST_PACKAGE>/<RUNNER_CLASS>\n" +
643                "        -e <testrunner_flag> <testrunner_value> [,<testrunner_value>]\n" +
644                "        -w wait for the test to finish (required)\n" +
645                "        -r use with -e perf true to generate raw output for performance measurements\n" +
646                "\n" +
647                "    start profiling: am profile <PROCESS> start <FILE>\n" +
648                "    stop profiling: am profile <PROCESS> stop\n" +
649                "    dump heap: am dumpheap [flags] <PROCESS> <FILE>\n" +
650                "        -n: dump native heap instead of managed heap\n" +
651                "\n" +
652                "    <INTENT> specifications include these flags:\n" +
653                "        [-a <ACTION>] [-d <DATA_URI>] [-t <MIME_TYPE>]\n" +
654                "        [-c <CATEGORY> [-c <CATEGORY>] ...]\n" +
655                "        [-e|--es <EXTRA_KEY> <EXTRA_STRING_VALUE> ...]\n" +
656                "        [--esn <EXTRA_KEY> ...]\n" +
657                "        [--ez <EXTRA_KEY> <EXTRA_BOOLEAN_VALUE> ...]\n" +
658                "        [--ei <EXTRA_KEY> <EXTRA_INT_VALUE> ...]\n" +
659                "        [--el <EXTRA_KEY> <EXTRA_LONG_VALUE> ...]\n" +
660                "        [--eia <EXTRA_KEY> <EXTRA_INT_VALUE>[,<EXTRA_INT_VALUE...]]\n" +
661                "        [--ela <EXTRA_KEY> <EXTRA_LONG_VALUE>[,<EXTRA_LONG_VALUE...]]\n" +
662                "        [-n <COMPONENT>] [-f <FLAGS>]\n" +
663                "        [--grant-read-uri-permission] [--grant-write-uri-permission]\n" +
664                "        [--debug-log-resolution]\n" +
665                "        [--activity-brought-to-front] [--activity-clear-top]\n" +
666                "        [--activity-clear-when-task-reset] [--activity-exclude-from-recents]\n" +
667                "        [--activity-launched-from-history] [--activity-multiple-task]\n" +
668                "        [--activity-no-animation] [--activity-no-history]\n" +
669                "        [--activity-no-user-action] [--activity-previous-is-top]\n" +
670                "        [--activity-reorder-to-front] [--activity-reset-task-if-needed]\n" +
671                "        [--activity-single-top]\n" +
672                "        [--receiver-registered-only] [--receiver-replace-pending]\n" +
673                "        [<URI>]\n"
674                );
675    }
676}
677