Google Assistant voice search integration doesn't work with multiple words


In my Android project we recently added Voice Search following the documentation. It works fine, however only when searching one word. It doesn't seem to be an intended behaviour since in Google's examples they search for "trips to Maui".

We've tried many search commands on different devices using Google Assistant app (latest version), as well as launching via adb.

So, what works for us: "Ok Google, search for chocolate on {ourApp}".

adb shell am start -a  --es query 'chocolate'

Result: app is launched on proper screen with proper query

What doesn't work though: "Ok Google, search for ice cream on {ourApp}".

adb shell am start -a  --es query 'ice cream'

Result: Google Assistant displays web search results and via adb we get:

Starting: Intent { pkg=cream (has extras) }
Error: Activity not started, unable to resolve Intent { flg=0x10000000 pkg=cream (has extras) }

This looks as if the command was not proper though, as system recognises "cream" as package name. The result is the same even if we explicitly add package name to the adb command.

Our integration code:


        <action android:name=""/>
        <category android:name="android.intent.category.DEFAULT"/>


And then in SearchResultsActivity:

searchTerm = intent.getStringExtra(SEARCH_TERM_KEY) ?: intent.getStringExtra(SearchManager.QUERY).orEmpty()

How to achieve multiple-words search using Google Assistant?

asked on Stack Overflow Jan 21, 2019 by maya_t

1 Answer


I can't tell you why (documentation not found), but spaces need to be escaped.

Therefore, this is your fixed example:

adb shell am start -a  --es query 'ice\ cream'

As a workaround, I wrote the following script (named

inputQuery=$(printf %q "$1")
adb shell am start -a -e query "$inputQuery"

This is how you run it:

sh "ice\ cream"
answered on Stack Overflow Jul 29, 2019 by gianlucaparadise

User contributions licensed under CC BY-SA 3.0