Stack Exchange
Android - ADB Command in Command Prompt (Windows)
I have an ADB command to be executed in Command Prompt. The purpose of this command is to test Google Analytics Campaign Measurement implementation on my app. 
Below code is the command:
adb shell am broadcast -a com.android.vending.INSTALL_REFERRER -n com.example.androidapp/.app.service.CustomReceiver --es "referrer" "utm_source=testSource&utm_medium=testMedium&utm_term=testTerm&utm_content=testContent&utm_campaign=testCampaign"

This command sends broadcast to app, so when I access "referrer" parameter, I could get this string:
"utm_source=testSource&utm_medium=testMedium&utm_term=testTerm&utm_content=testContent&utm_campaign=testCampaign"

However, after testing that code, the only value I could get is:
"utm_source=testSource"

Then I remember that "&" character means ESCAPE in Command Prompt. So, I tried to use "^&" instead of "&", but I get this result:
"utm_source=testSource^"

How do I get the full string? Or what should I add to my code?

Escape it with \ instead of ^ 
adb is basically executing the command in shell and not in Windows command prompt. ^ escapes the character in Windows command prompt, but in shell, you'll have to use \

Did you mean using \& instead of ^&? I tried but I got this output: "utm_source=testSource\". Still not a complete string. Please help!

Can you go into shell and execute it? Type adb shell and press enter, and then try executing am broadcast... command. And yes, use \&

Got the same problem before. What you need to do is type adb shell first, then hit Enter. Continue to fill other command in shell mode.
The & character works fine in shell mode!

Please add an explanation on why this should solve the problem and how it works. See this page for guidance
