简体   繁体   中英

How to launch my Android application using adb shell?

I'm trying to start an Android application using adb shell. I'm not succeeding

The AndoridManifest.XML is pasted below:

<?xml version="1.0" encoding="UTF-8"?>
<manifest android:versionCode="4" android:versionName="0.0.5.0" android:installLocation="auto" package="com.supascale.supascale" xmlns:android="http://schemas.android.com/apk/res/android">
<application android:label="@string/app_name" android:icon="@drawable/i_c_o_n_e________1">
    <activity android:theme="@android:style/Theme.Translucent" android:label="@string/app_name" android:name=".wdgen.GWDPSupaScale_Android$WDLanceur">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity> 
    ...

I tried the following call:

adb shell am start -a android.intent.action.MAIN -n com.supascale.supascale/com.supascale.supascale.wdgen.GWDPSupaScale_Android

This does'nt work ... I've tried all sorts of itterations after the ... /

I get Error type 3, the intent class does not exist!

Any help will be greatly appreciated. Regards Adrian

Some of my error messages: 在此处输入图片说明

You should escape the $ - \\$ - since otherwise it gets changed to nothing. $WDLanceor is interpreted as a shell variable by the android shell, and since the variable is not set it becomes an empty string.

Quoting the arguments ( adb ... -n "... GWDPSupaScale_Android$WDL‌​a‌​nceur" ) will only quote it on the Windows side, when it goes into the shell on the android side it'll be without quotes. The backslash will survive the Windows command prompt and be converted to an actual $ on the android shell.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM