13
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

adbでURL SchemeからActivityを開く

Last updated at Posted at 2017-03-24

こんにちはsekitakaです。

Androidアプリを開発していると独自のURL Schemeを設定したアプリを開発することはよくあります。
ただこのURL Schemeからアプリを起動する仕組みの確認が、以下の理由で少し手間に感じると思います。

  • プロトコルがhttp/https以外メール経由ではリンクにならない
  • Webページ上にリンクを作れば良いけど、まだ外部に公開したくない
  • かと言ってプライベートなページを作るほどでも。。。

今回はadbを使って、URL SchemeからActivityを起動する方法を紹介します。

シンプルに1行だけ。

adb shell am start -a android.intent.action.VIEW -d "https://www.google.co.jp"

このコマンドの例ではブラウザが起動しgoogleのページが表示されます。
https://www.google.co.jpには実際に試したいURL Schemeを指定してください。

2022年追記

公式ドキュメントに記載がありました。

13
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
13
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?