After installing and configuring the App Controller 2.9 it is time to start with application wrapping. With application wrapping you sign the application and convert/save it to an MDX file. You can upload both APK (Android) and IPA (iOS) as MDX files to the XenMobile App Controller, but with MDX files you have the additional ability to configure policies and to run the application in a sandbox.
You can wrap the applications with the Citrix MDX Toolkit . Keep in mind that this MDX Toolkit only runs on Mac OS X Lion or higher and not on a Windows machine.
In this blog I will show you how to prepare and how to wrap applications with the MDX Toolkit.
Preperations
General;
- Download Java SE Development Kit 7 for Mac OS X64
- Download the Citrix MDX Toolkit & SDK for iOS and Android Build 2.2.1 v372
For Android;
- Download the Android Software Development Kit (SDK)
- Download the Android APK Tool for Mac OSX, you need the apktool-install-macosx-r05-ibot.tar.bz2 and the apktool1.5.2.tar.bz2 files.
For iOS;
- Download your iOS Distribution Provisioning Profile
- Download Command Line Tools for Xcode
Installing Java SE Development Kit 7 for Mac OS
Double click the jdk-7u51-macosx-x64.dmg file
Double click on JDK 7 Update 51.pkg
Click on Continue
Click on Install
Click on Close
Installing the Android SDK Platform Tools
Go to the downloaded Android Software Development Kit and browse to adt-bundle-mac-x86_64-20131030 > sdk > tools and double click the android application
Click on Open
Make sure you select the following Tools;
– Android SDK Tools Rev. 22.3
– Android SDK Platform-tools Rev. 19
– Android SDK Built-tools Rev. 18.0.1
– Android SDK Built-tools Rev. 17
Click on Install <x> packages.
On the left side select Android SDK License, on the right side select Accept License and click Install.
After the installation close the dialog boxes (3).
Installing the Android APK Tool
Double click the apktool-install-macosx-r05-ibot.tar.bz2 and the apktool1.5.2.tar.bz2 file to uncompressed the files.
Copy the following files to adt-bundle-mac-x86_64-20131030 > sdk > tools ;
– Apktool-install-macosx-r05-ibot > aapt
– Apktool-install-macosx-r05-ibot > apktool
– Apktool1.5.2 > apktool.jar
To add the folders to the path variable, open Terminal and type the following command;
~/.bash_profile; open ~/.bash_profile
Add the following lines to the file;
Export PATH=”$HOME/Downloads/adt-bundle-mac-x86_64-20131030/sdk/platform-tools:$PATH”
Export PATH=”$HOME/Downloads/adt-bundle-mac-x86_64-20131030/sdk/build-tools:$PATH”
Export PATH=”$HOME/Downloads/adt-bundle-mac-x86_64-20131030/sdk/tools:$PATH”
Click File > Save a Version, and close the dialog box
To create the keystore key run the following command;
Keytool –genkey –keyalg DSA –alias <keystorename>.keystore –storepass <any-password> -keysize 1024
NOTE: The key must have a 1024 bit keysize and a DSA key algorithm
Enter your first and last name
Enter the name of your organizational unit
Enter the name of your organization
Enter the name of your City or Locality
Enter the name of your State or Province
Enter the two-letter country code for this unit
If everything is correct, type Yes
Enter a key password
Run the following command to copy the keystore file to the downloads folder;
cp .keystore Downloads/<keystorename>.keystore
Install the Command Line Tools for Xcode
Double click the xcode462_cltools_10_76938260a.dmg file
Double click Command Line Tools (Lion).mpkg
Click Continue
Click Continue
Click Agree
Click Install
Click Close
Install the Citrix MDX Toolkit
Double click the MDXToolkit.mpkg file
Click Continue
Click Continue
Click Agree
Click Install
Click Close
Wrapping an application
For this example I will wrap WorxMail for Android. The steps to wrap an iOS application are almost the same. The only difference is that you must select an IPA file instead of an APK file and that you have to specify a iOS Distribution Provisioning Profile and iOS Distribution Certificate instead of the Android SDK and the Keystore.
Start the MDX Toolkit
Select For IT administrator and click Next
Browse to the APK file and click Next
You have to provide the path to the top-level of the Android SDK the first time you wrap an Android application. Click Browse
Select the adt-bundle-mac-x86_64-20131030 > sdk folder and click Open
Click Next
Click Next
Browse to the keystore file created in the previous steps and click Next
Enter the password you entered while creating the key and click Next
Click Create
Enter the alias password you entered while creating the key and click Create
Give the MDX file a name you want and click Create
Click Finish
Hi, Robin
Great post, thank you for share with us.
This was useful, thanks
Hi
I am not a MAC user normally and I hit a few hurdles with these instructions. May be useful to others:-
– Open messes with the double quote character and writes to .bash_profile the wrong character (although it looks like double quotes) Us vi to edit this file instead.
– Cut and paste of the key tool syntax results in an error that keygen is invalid option. If you cut and paste from the web replace the dashes with dashes as these are a different character also.
Other than that Thanks to RobinHobo for these instructions. The Citrix Doco is pretty poor on this.
AD
Thanks!
Hi,
Great Post really helping us out.
We are hitting a bit of a snag it seems when we create the Bash_profile file and adding the Export Paths you have yours pointing from $HOME/Downloads we created a directory in $HOME/Documents and created a file structure Android/SDK-Platform/adt…
when we save the file we can no longer open Bash_Profile using command open /.bash_profile of which turns out to be a permission denied error, is there a reason why you use Downloads and why we can not use another directory? is it possible?
I used the downloads folder because on that location was the SDK, you can use any other location that you want.
Great, extremely useful.
Thanks Ravi
Has anyone had issues after wrapping apps for Android that they will only install on Android 4.3 or 4.4 but not on anything older on 4.x.x
The application starts to download but then errors out stating WorxHome could not connect and it never installs?
In the beginning under preparations, it is mentioned to Download apktool1.6.2.tar.bz2 for Android but apktool1.5.2.tar.bz2 is only available. I presume it was a typo as the other steps guide to install 1.5.2.
Thanks, was a typo 😉
Thanks for this post!
I succeeded to wrap IPA files.
Unfortunately, wrapping the APK files didn’t work.
I get in the MDX toolkit empty fields in the section Verify App Details.
Of course I filled in these empty fields, but then MDX toolkit freezes.
Hi Marcel, have the same problem. Even with the latest version of the MDX Toolkit (except the freezing). Have you update you Mac with the latest updates? Are you using the latest MDX Toolkit?
Having the same problem. Mac OS X 10.10 is freshly installed, using all the prerequisites described in http://support.citrix.com/article/CTX140458 i am still having the same problem.
We are using the following versions:
OS X Yosemite 10.10.1
Android SDK Build-tools 21.1.2 (even tried different build-tools versions)
MDX Toolkit 10
All APK files are having the same problem.
Solved! The android_settings.txt wasn’t complete.
The working one:
PATH = /users/username/Downloads/Install/android-sdk-macosx/platform-tools:/users/username/Downloads/Install/android-sdk-macosx/build-tools/21.1.2:/users/username/Downloads/Install/android-sdk-macosx/tools
[…] to XenMobile. Applications should be wrapped using the Citrix MDX toolkit. Robin Hobo wrote a nice article on how to do […]
Is this article still relevant for wrapping iOS and Android Worx apps for XenMobile 10.x?
In basic it is.
Nice article, thanks!
I followed it but I got an error when wrapping an app:
###Analyzing app…
————————————————————————-
Using package-specific policies.
I: Generating new resources
I: Creating a new R.java
Unexpected error occurred: String index out of range: -1
—
I checked /Applications/Citrix/MDXToolkit/android_settings.txt and it points to the correct paths.
Any ideas/suggestions/directions??
Thanks in advance.
Hi Alejandro,
Had this same problems some time ago. Updating the Android SDK and edit the android_settings paths to the latest builds solved my problem.
Regards,
Robin