Different way of installing apk file

948 views Asked by At

I get issue when install apk file, follow is: 1. A apk file copy from /bin of Eclipse

Way 1:

Use commandline: adb install [path to apk file]

Result 1: - Go to anywhere in app then touch home button.

  • Use launcher re run app, app go to previous screen (ok)

Way 2:

Copy that apk file to sdcard and run directly by click it.

Result 1:

  • Go to anywhere in app then touch home button.

- Use launcher re run app, app go to first screen (not ok)

AndroidManifest: these are definned in tag application

android:allowBackup="true"
android:hardwareAccelerated="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:largeHeap="true"
android:launchMode="singleTop"
android:logo="@drawable/ic_launcher"

How can i export APK and install it direct and result like install by adb or ctrl + f11 in Eclipse?


Big thanks to @marek-sebera. I resolved my issue, it's different in how to open my app, isn't how to install an app.

1

There are 1 answers

4
Marek Sebera On BEST ANSWER

Use the procedure Eclipse uses, but manually:

  • Push APK into temp
  • Install APK via ADB
  • Run application

example

adb push bin/my_app-debug.apk /data/local/tmp/my_app-debug.apk
pm install -r "/data/local/tmp/my_app-debug.apk"
am start -n "my.package.name/my.package.name.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER

replace my_app-debug.apk and my.package.name with real info of your application