[BUG] Install script for installing Android APK and OBB fails

I’m using the 4.8.0 Preview 4 on OS X. I successfully built an Android APK with the game files in an OBB file. But when I run the installation script, it fails.

After some tinkering, it looks like the issue is that I had a space in the field pathway to the Android SDK on my computer. I updated the field pathway to have underscores “_” and updated the file pathway in the script, which removed the issue of not finding the SDK in the script.

But there was still a syntax error with the parentheses on line 33 of the script. Adding the backslash "" escape character before the parentheses fixed the issue.

But it still won’t install.

Here is the script file (zipped so it’d upload): link text

Here is the output from the terminal:

Last login: Thu Jun  4 22:34:31 on ttys000
/Users/jonathandaley/Documents/Unreal\ Projects/Android_ATC/Install_TestAndroidProj_Development-armv7-es2.command ; exit;
My-MacBook-Pro-2:~ jonathandaley$ /Users/jonathandaley/Documents/Unreal\ Projects/Android_ATC/Install_TestAndroidProj_Development-armv7-es2.command ; exit;
/Users/jonathandaley/Documents/Unreal Projects/Android_ATC/Install_TestAndroidProj_Development-armv7-es2.command: line 4: SDK/adt-bundle-mac-x86_64-20130514/sdk/platform-tools: No such file or directory

Uninstalling existing application. Failures here can almost always be ignored.
/Users/jonathandaley/Documents/Unreal Projects/Android_ATC/Install_TestAndroidProj_Development-armv7-es2.command: line 9: uninstall: command not found

Installing existing application. Failures here indicate a problem with the device (connection or storage permissions) and are fatal.
usage: install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
               [-o owner] file1 file2
       install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
               [-o owner] file1 ... fileN directory
       install -d [-v] [-g group] [-m mode] [-o owner] directory ...

There was an error installing the game or the obb file. Look above for more info.

Things to try:
/Users/jonathandaley/Documents/Unreal Projects/Android_ATC/Install_TestAndroidProj_Development-armv7-es2.command: line 33: syntax error near unexpected token `('
/Users/jonathandaley/Documents/Unreal Projects/Android_ATC/Install_TestAndroidProj_Development-armv7-es2.command: line 33: `echo Check that the device (and only the device) is listed with \"$ADB devices\" from a command prompt.'
logout

[Process completed]

Hi JonathanADaley,

When you say ‘installation script’ is this one you have created yourself, or the batch file that is created in packaging? Do you get the same error when you attempt to install the .apk with the batch file that is created when you package?

This happens with the batch file that is generated when packaging.

Hi,

It looks like you might have your environment variable for ANDROID_HOME set to the wrong path. Set this to the directory where you installed the Android SDK or the sdk directory if you installed Android Development Tools. It must contain a directory called platform-tools. Here is a Stack Overflow thread that has clear Mac instructions.

Good luck!

Just a quick update; I wasn’t able to get the install script working on OS X, but it does work on Windows.

I used the NVIDIA TADP to install everything on Windows, but didn’t on OS X (I had installed SDKs using Eclipse several years ago, then updated SDKs with Android Studio, and then installed what was missing for UE4 (NDK, ANT, etc.) using the TADP).

I probably just missed something on OS X. But at least it’s working on Windows.

Yeah, the piecemeal SDKs probably has something to do with it, especially if you’re using source and being required to compile for Android to package.

Unfortunately, we’re in kind of a weird place with Android SDKs.TADP isn’t a thing anymore, it is now AndroidWorks. You can get by with installing the version of TADP that is included with UE4 onto your Mac; it’s a pretty old version. Getting support for AndroidWorks is a top priority but I am not 100% sure it’s going to happen prior to the 4.9 release. If packaging for Mac is a priority for you right now, I’d install the TADP that comes with UE4.