我想從Android終端模擬器啓動應用程序,我似乎無法獲取命令的語法或上下文。如何從終端模擬器啓動Android應用程序
am start -n
這就是我所擁有的。
的應用程序存儲在/data/app
文件夾
APP數據存儲在/data/data
文件夾
這是我都試過了。
am start -n /data/app/com.hcg.cok.gp-1.apk/ com.hcg.com.gp/ com.clash.of.kings.EmpireActivity
我知道這是一個語法錯誤或上下文錯誤,有人可以告訴我我做錯了什麼嗎?這是我從shell獲得的錯誤。
[email protected]:/ $ su om.hcg.cok.gp-1.apk /.com.clash.of.kings.EmpireActivity < Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=/data/app/com.hcg.cok.gp-1.apk } Error type 3 Error: Activity class {/data/app/com.hcg.cok.gp-1.apk} does not exist. ta/com.hcg.cok.gp /com.clash.of.kings.EmpireActivity < Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=/com.clash.of.kings.EmpireActivity } Error type 3 Error: Activity class {/com.clash.of.kings.EmpireActivity} does not exist. [email protected]:/ #
我收到了其他錯誤,因爲我嘗試了所有我能想到的來改變輸入內容。以下是我嘗試過的所有不同的方法。
am start -n /data/data/com.hcg.cok.gp/ ./data/app/com.hcg.cok.gp/ .com/clash.of.kings.EmpireActivity
am start -n /data/app/com.hcg.cok.gp-1.apk/ .EmpireActivity
am start -n /data/app/com.hcg.cok.gp-1.apk/ ./data/data/com.hcg.cok.gp/ .com.clash.of.kings.EmpireActivity
我已經從字面上試過這種方式,我可以想到我有什麼錯誤?我需要從shell啓動這個遊戲,以便我可以將輸入的tap命令傳遞給它,而不會被收入文本,電子郵件或任何其他會迫使應用程序進入後臺並破壞我的輸入流向遊戲的事件中斷,我在tasker中構建,只要我的手機沒有其他任何東西可以完美地執行shell工作的輸入命令,但是如果系統中發生任何其他事情,它會將遊戲推入後臺,等到它返回到前臺shell現在已經模擬了水龍頭,但是對於在遊戲前放到前景d的應用程序,它破壞了我正在嘗試做的事情,所以我的想法是如果我可以從shell啓動遊戲,並且將我的輸入命令傳遞到同一個shell中,如果遊戲被強制進入後臺,它將無關緊要,因爲它在我的Input命令也在運行的shell中運行。對不起,在一些代碼的錯誤,這是在我的終端是正確的,但我的手機不喜歡論壇,並不斷刪除信件或改變他們的情況。我不在我的電腦附近,所以我無法輕鬆修復這些錯誤。
這是整個清單,我有包和活動是正確的,是有可能,它不發射,因爲我還沒有設置shell的UID?有一個在清單一行,討論有關檢查用戶
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:"http://schemas.android.com/apk/res/android" android:versionCode="708" android:versionName="1.1.10" android:installLocation="preferExternal" package="com.hcg.cok.gp" platformBuildVersionCode="22" platformBuildVersionName="5.1-1756733">
<supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" />
<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="22" />
<uses-permission android:name="com.android.vending.BILLING" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_DEVICE_STATS" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
<uses-permission android:name="android.permission.GET_TASKS" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<permission android:name="com.hcg.cok.gp.permission.C2D_MESSAGE" android:protectionLevel="signature|signatureOrSystem" />
<uses-permission android:name="com.hcg.cok.gp.permission.C2D_MESSAGE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<application android:label="@string/app_name" android:icon="@drawable/cok_icon" android:name="com.clash.of.kings.EmpireApplication" android:debuggable="false" android:largeHeap="true">
<meta-data android:name="com.google.android.gms.games.APP_ID" android:value="@string/app_id" />
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
<activity android:theme="@style/MyTheme" android:label="@string/app_name" android:name="com.clash.of.kings.EmpireActivity" android:launchMode="standard" android:screenOrientation="portrait" android:configChanges="keyboardHidden|orientation">
<meta-data android:name="XINGCLOUD_CHANNEL" android:value="market" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="org.hcg.stac.empire.intent.action.IF" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="cok" />
</intent-filter>
<meta-data android:name="io.branch.sdk.BranchKey" android:value="key_live_knjHdkLtLaoWWChZ9ZmCIgipAAnT53Wn" />
<intent-filter>
<data android:scheme="cokBranch" android:host="open" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
</activity>
<meta-data android:name="com.facebook.sdk.ApplicationName" android:value="@string/app_name" />
<activity android:theme="@*android:style/Theme.Translucent.NoTitleBar" android:label="@string/app_name" android:name="com.facebook.FacebookActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize" />
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/fb_app_id" />
<provider android:name="com.facebook.FacebookContentProvider" android:exported="true" android:authorities="com.facebook.app.FacebookContentProvider713457855362204" />
<meta-data android:name="AdjustAppToken" android:value="cbc4rfy5xrad" />
<meta-data android:name="AdjustLogLevel" android:value="info" />
<meta-data android:name="AdjustEnvironment" android:value="production" />
<meta-data android:name="AdjustEventBuffering" android:value="true" />
<receiver android:name="com.appsflyer.AppsFlyerLib" android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
<receiver android:name="it.partytrack.sdk.ReferrerReceiver" android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
<receiver android:name="com.adjust.sdk.ReferrerReceiver" android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
<receiver android:name="com.google.ads.conversiontracking.InstallReceiver" android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
<receiver android:name="com.clash.of.kings.COKInstallReceiver" android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
<receiver android:name="com.inmobi.commons.analytics.androidsdk.IMAdTrackerReceiver" android:enabled="true" android:exported="true">
<intent-filter>
<action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
<action android:name="com.inmobi.share.id" />
</intent-filter>
</receiver>
<activity android:theme="@*android:style/Theme.Translucent.NoTitleBar" android:name="com.inmobi.androidsdk.IMBrowserActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenSize|smallestScreenSize" android:hardwareAccelerated="true" />
<service android:name="org.hcg.notifies.LocalNotificationIntentService" />
<receiver android:name="org.hcg.notifies.LocalBroadcastReceiver" />
<receiver android:name="org.hcg.stac.empire.common.manager.NotificationReceiver" android:process=":remote">
<intent-filter>
<action android:name="com.hcg.cok.intent.action.NOTIFICATION" />
<action android:name="com.hcg.cok.intent.action.FREE_LOTTERY" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver>
<service android:name="com.google.analytics.tracking.android.CampaignTrackingService" />
<meta-data android:name="UMENG_APPKEY" android:value="526f648856240b025f008fff" />
<meta-data android:name="UMENG_CHANNEL" android:value="android_marekt_global" />
<meta-data android:name="TESTIN_APPKEY" android:value="ed64e49e02a4441326ac32a2598cf0af" />
<meta-data android:name="TESTIN_CHANNEL" android:value="android_marekt_global" />
<meta-data android:name="com.parse.push.gcm_sender_id" android:value="id:312229299745" />
<receiver android:name="com.parse.GcmBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.hcg.cok.gp" />
</intent-filter>
</receiver>
<receiver android:name="com.google.android.gcm.GCMBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.hcg.cok.gp" />
</intent-filter>
</receiver>
<service android:name="org.hcg.stac.empire.common.manager.GCMIntentService" />
<activity android:name="com.umeng.api.activity.OauthActivity" android:screenOrientation="unspecified" android:configChanges="keyboardHidden|orientation" android:windowSoftInputMode="10" />
<activity android:theme="@style/Theme_IOSched" android:name="com.umeng.api.activity.UpdateStatusActivity" android:screenOrientation="unspecified" android:configChanges="keyboardHidden|orientation" android:windowSoftInputMode="14" />
<activity android:name="com.tapjoy.TJCOffersWebView" android:configChanges="keyboardHidden|orientation" />
<activity android:name="com.tapjoy.TapjoyFeaturedAppWebView" android:configChanges="keyboardHidden|orientation" />
<activity android:name="com.tapjoy.TapjoyVideoView" android:configChanges="keyboardHidden|orientation" />
<activity android:name="com.sponsorpay.sdk.android.publisher.OfferWallActivity" android:configChanges="orientation" />
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
<service android:name="com.parse.PushService" />
<receiver android:name="com.parse.ParseBroadcastReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.USER_PRESENT" />
</intent-filter>
</receiver>
<receiver android:name="com.parse.ParsePushBroadcastReceiver" android:exported="false">
<intent-filter>
<action android:name="com.parse.push.intent.RECEIVE" />
<action android:name="com.parse.push.intent.DELETE" />
<action android:name="com.parse.push.intent.OPEN" />
</intent-filter>
</receiver>
<receiver android:name="com.clash.of.notifies.HFParseCustomReceiver" android:exported="false">
<intent-filter>
<action android:name="com.hcg.cok.gp.UPDATE_STATUS" />
</intent-filter>
</receiver>
<activity android:theme="@style/Helpshift_Theme_Activity" android:label="@string/hs__conversation_header" android:name="com.helpshift.HSConversation" android:configChanges="locale|orientation|screenSize|layoutDirection" />
<activity android:theme="@style/Helpshift_Theme_Activity" android:name="com.helpshift.HSQuestionsList" android:configChanges="orientation|screenSize" />
<activity android:theme="@style/Helpshift_Theme_Activity" android:label="@string/hs__question_header" android:name="com.helpshift.HSQuestion" android:configChanges="orientation|screenSize" android:hardwareAccelerated="true" />
<activity android:theme="@style/Helpshift_Theme_Activity" android:name="com.helpshift.HSSection" android:configChanges="orientation|screenSize" android:windowSoftInputMode="20" android:hardwareAccelerated="true" />
<activity android:theme="@style/Helpshift_Theme_Activity" android:label="@string/hs__help_header" android:name="com.helpshift.HSFaqs" android:configChanges="orientation|screenSize" android:windowSoftInputMode="20" android:hardwareAccelerated="true" />
<activity android:theme="@style/Helpshift_Theme_Dialog" android:name="com.helpshift.HSReview" android:configChanges="orientation|screenSize" />
<activity android:theme="@style/Helpshift_Theme_Activity" android:name="com.helpshift.ScreenshotPreviewActivity" android:configChanges="orientation|screenSize" />
<activity android:theme="@style/Helpshift_Theme_Activity" android:name="com.helpshift.SearchResultActivity" android:configChanges="orientation|screenSize" />
<service android:label="Helpshift Service" android:name="com.helpshift.HSService" />
<service android:label="Helpshift Service" android:name="com.helpshift.HSRetryService" />
<meta-data android:name="com.vk.sdk.AppId" android:value="5024256" />
<activity android:name="com.vk.sdk.VKOpenAuthActivity" />
<activity android:theme="@style/VK_Transparent" android:label="ServiceActivity" android:name="com.vk.sdk.VKServiceActivity" />
<activity android:theme="@style/Activity_Theme" android:name="com.elex.chatservice.view.ChatActivity" android:screenOrientation="portrait" android:configChanges="locale|orientation|screenSize" />
<activity android:theme="@style/Activity_Theme" android:name="com.elex.chatservice.view.ChannelListActivity" android:screenOrientation="portrait" android:configChanges="locale|orientation|screenSize" />
<activity android:theme="@style/Activity_Theme" android:name="com.elex.chatservice.view.ForumActivity" android:screenOrientation="portrait" android:configChanges="locale|orientation|screenSize" />
<activity android:theme="@style/Activity_Theme" android:name="com.elex.chatservice.view.MemberSelectorActivity" android:screenOrientation="portrait" android:configChanges="locale|orientation|screenSize" />
<activity android:theme="@style/Activity_Theme" android:name="com.elex.chatservice.view.WriteMailActivity" android:screenOrientation="portrait" android:configChanges="locale|orientation|screenSize" />
<meta-data android:name="io.fabric.ApiKey" android:value="a9561a0f09e88d758810060aea57aac008e89d0c" />
<meta-data android:name="io.branch.sdk.BranchKey" android:value="key_live_knjHdkLtLaoWWChZ9ZmCIgipAAnT53Wn" />
</application>
您嘗試啓動的應用程序是否已安裝? (你說它是在數據/應用程序文件夾中,這是什麼意思?) – Darpan
是的,該應用程序已經安裝,我猜不是將其安裝在應用程序/ asec文件夾或使用開發人員選擇的應用程序/應用程序私有文件夾加載/data/data/com.hcg.cok.gp中的所有庫和資源文件夾,而應用程序包(apk)其自身已加載到data/app/com.hcg.cok.gp-1.apk文件夾中 –