{"id":220,"date":"2015-02-23T09:00:11","date_gmt":"2015-02-23T08:00:11","guid":{"rendered":"https:\/\/mokrzycki.eu\/blog\/?p=220"},"modified":"2021-09-07T08:54:43","modified_gmt":"2021-09-07T07:54:43","slug":"how-to-run-an-android-application-using-apk-file","status":"publish","type":"post","link":"https:\/\/mokrzycki.eu\/blog\/2015\/02\/23\/how-to-run-an-android-application-using-apk-file\/","title":{"rendered":"How to run an android application using .apk file?"},"content":{"rendered":"\n<p>Here is the example how to run apk when you do not know what is the apk&#8217;s name.<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>First you need to call aapt to get info about AndroidManifest.xml from interesting apk. I will show you example on WifiKillDOwnloader.apk<br \/>In console you call:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>aapt d xmltree WiFiKillDownloader.apk AndroidManifest.xml &amp;gt; manifest.txt<\/code><\/pre>\n\n\n\n<p>Console will output this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>N: android=http:\/\/schemas.android.com\/apk\/res\/android\nE: manifest (line=2)\nA: android:versionCode(0x0101021b)=(type 0x10)0x7\nA: android:versionName(0x0101021c)=\"1.7\" (Raw: \"1.7\")\nA: package=\"me.paranoid.wifikilld\" (Raw: \"me.paranoid.wifikilld\")\nE: uses-sdk (line=7)\nA: android:minSdkVersion(0x0101020c)=(type 0x10)0xe\nE: uses-permission (line=8)\nA: android:name(0x01010003)=\"android.permission.WRITE_EXTERNAL_STORAGE\" (Raw: \"android.permission.WRITE_EXTERNAL_STORAGE\")\nE: uses-permission (line=9)\nA: android:name(0x01010003)=\"android.permission.GET_ACCOUNTS\" (Raw: \"android.permission.GET_ACCOUNTS\")\nE: uses-permission (line=10)\nA: android:name(0x01010003)=\"android.permission.VIBRATE\" (Raw: \"android.permission.VIBRATE\")\nE: uses-permission (line=11)\nA: android:name(0x01010003)=\"android.permission.INTERNET\" (Raw: \"android.permission.INTERNET\")\nE: application (line=13)\nA: android:label(0x01010001)=@0x7f040000\nA: android:icon(0x01010002)=@0x7f020005\nE: activity (line=16)\nA: android:theme(0x01010000)=@0x103006b\nA: android:label(0x01010001)=@0x7f040000\nA: android:name(0x01010003)=\".WiFiKillDActivity\" (Raw: \".WiFiKillDActivity\")\nE: intent-filter (line=20)\nE: action (line=21)\nA: android:name(0x01010003)=\"android.intent.action.MAIN\" (Raw: \"android.intent.action.MAIN\")\nE: category (line=23)\nA: android:name(0x01010003)=\"android.intent.category.LAUNCHER\" (Raw: \"android.intent.category.LAUNCHER\")<\/code><\/pre>\n\n\n\n<p>OK, now you must find values for apk <strong>package=&#8221;XXX&#8221;<\/strong> and <strong>android:name<\/strong> to use in this scheme:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>adb shell am start -a android.intent.action.MAIN -n package\/activity<\/code><\/pre>\n\n\n\n<p>When we get it, we call in this way:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>adb shell am start -a android.intent.action.MAIN -n me.paranoid.wifikilld\/.WiFiKillDActivity<\/code><\/pre>\n\n\n\n<p><strong>Q&amp;A<\/strong><br \/>Apt is placed in folder <strong>$ANDROID_SDK\/build-tools\/<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here is the example how to run apk when you do not know what is&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[500],"tags":[135,5,150,146,147,145,144,149,148],"_links":{"self":[{"href":"https:\/\/mokrzycki.eu\/blog\/wp-json\/wp\/v2\/posts\/220"}],"collection":[{"href":"https:\/\/mokrzycki.eu\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mokrzycki.eu\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mokrzycki.eu\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mokrzycki.eu\/blog\/wp-json\/wp\/v2\/comments?post=220"}],"version-history":[{"count":19,"href":"https:\/\/mokrzycki.eu\/blog\/wp-json\/wp\/v2\/posts\/220\/revisions"}],"predecessor-version":[{"id":931,"href":"https:\/\/mokrzycki.eu\/blog\/wp-json\/wp\/v2\/posts\/220\/revisions\/931"}],"wp:attachment":[{"href":"https:\/\/mokrzycki.eu\/blog\/wp-json\/wp\/v2\/media?parent=220"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mokrzycki.eu\/blog\/wp-json\/wp\/v2\/categories?post=220"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mokrzycki.eu\/blog\/wp-json\/wp\/v2\/tags?post=220"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}