0

I need to open url from shell script on android, in lightning or at least in default browser. To open browser I use following code:

#!/bin/sh
monkey -p  acr.browser.barebones -c android.intent.category.LAUNCHER 1

This is not duplicate as I need not only default browser.

5
  • Possible duplicate of How to open a URL from terminal Commented Apr 16, 2018 at 17:33
  • One more question, how to make it work from not root shell? Commented Apr 16, 2018 at 18:22
  • How do you mean? Commented Apr 16, 2018 at 18:43
  • When running monkey -p acr.browser.barebones -c android.intent.category.LAUNCHER 1 not from root shell - it not working Commented Apr 16, 2018 at 19:06
  • what error did you receive? Commented Apr 16, 2018 at 19:42

1 Answer 1

0

To open url monkey not needed:

root@dolphin-fvd-p1:/opt/etc # cat OpenURL                                                                      
#!/bin/sh

PATH=/opt/sbin:/opt/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH

am start --user 0 -a android.intent.action.VIEW -d $1 acr.browser.barebones

To start browser on home page:

root@dolphin-fvd-p1:/opt/etc # cat StartBrowser                                                                 
#!/bin/sh

PATH=/opt/sbin:/opt/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH

am start --user 0  acr.browser.barebones
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.