-
Notifications
You must be signed in to change notification settings - Fork 182
Android Development
jab edited this page Aug 3, 2016
·
20 revisions
uProxy can now be built as an Android app using the Cordova Chrome Apps (CCA) tool, a.k.a. Chrome Apps for Mobile Toolchain.
After building uProxy for desktop:
- Install the Android SDK.
- Linux: Since the command-line tools are largely unmaintained, the easiest way to get them is as part of Android Studio. Download the installer and start Android Studio; on first run, it will prompt you to install an SDK. Then add the Android tools to your path, e.g.
export PATH=$PATH:$HOME/android-studio/tools. - OS X:
brew install android-sdk
- Linux: Since the command-line tools are largely unmaintained, the easiest way to get them is as part of Android Studio. Download the installer and start Android Studio; on first run, it will prompt you to install an SDK. Then add the Android tools to your path, e.g.
- Set your
ANDROID_HOMEenvironment variable to the Android SDK path, e.g. runexport ANDROID_HOME=$HOME/Android/Sdkand add it to your.bashrc(/usr/local/opt/android-sdkon OS X). - Install
adb.- Linux:
adbis available through your package manager. For example, on Ubuntu runapt-get install android-tools-adb. - OS X:
adbshould have been installed by thebrew install android-sdkstep already. Make sure withwhich adb.
- Linux:
- Confirm that your
ccapackage is ready by runningnode_modules/.bin/cca checkenvfrom your git clone root directory. - Install the Android NDK (
brew install android-ndkon OS X). - Confirm that
ndk-buildis in yourPATHwithwhich ndk-build. - Run the Android SDK Manager (e.g. invoke
androidat the command line) and ensure that "SDK Platform" is installed for Android 6.0 (API 23). If you ended up with "SDK Platform" installed for Android 7.0 (API 24) only, you'll still need to install the 6.0/API 23 SDK Platform.
Now, you can build the app using grunt build_android. The output, a file ending
in .apk, will appear in build/dev/uproxy/android/platforms/android/build/outputs/apk/.
Depending on the build configuration, the file might be named android-debug.apk,
android-armv7-debug.apk, etc..
- To install the app, first Enable USB Debugging on your test phone, then connect it to your computer and accept the connection on the phone.
- Then, on your computer, install the app on the phone using a command like
adb install -r build/dev/uproxy/android/platforms/android/build/outputs/apk/android-debug.apk. - You may then launch the app from the phone. Rerunning this command should close the app and replace it with a new version, but will not overwrite saved state on the device.
If you encounter an error or want to complete delete uProxy from your phone, you can do so via
Settings -> Apps -> uProxy, which as a button labeled "Uninstall for all users".
- Create a virtual device using the Android Virtual Device Manager with an API of 23 (Marshmallow) or higher.
- Launch the emulator and check
adb devicesat the command line to make sure an emulator is running. - Install the app from the command line with
adb install -r build/dev/uproxy/android/platforms/android/build/outputs/apk/android-debug.apk. You should seesuccessif the app is installed. - You may then launch the app from the emulator.
Android app release builds must be signed. To create a release build:
- Get the appropriate
play_store_keys.p12andandroid-release-keys.propertiesfiles, and symlink them into akeysdirectory in the git repo root.
- The uProxy team's release keys are stored in a secure location, not in the public git repository. Symlinking ensures that you do not accidentally copy the keys into insecure storage.
- Run
grunt release_android - From the
build/dev/uproxy/android/platforms/android/build/outputs/apk/directory, uploadandroid-release.apk,android-x86-release.apk, andandroid-armv7-release.apkto the Play Store using the multiple APK upload procedure.
- This allows us to have a smaller build (~10 MB) for modern Android, and a larger build (~33 MB) for older Android versions that need Crosswalk because the system webview is too old to run uProxy.