Diagnosing ADF Mobile iOS deployment problems

Posted by Chris Muir on Oracle Blogs See other posts from Oracle Blogs or by Chris Muir
Published on Wed, 6 Nov 2013 06:41:15 +0000 Indexed on 2013/11/06 10:01 UTC
Read the original article Hit count: 510

Filed under:

From time to time I encounter customers who have taken possession of a brand new Apple Mac, have that excited "I've just spent more on a computer then I ever wanted to but it's okay" crazy gleam in their eye, but on pre-loading all the necessary software for Oracle's ADF Mobile to start their mobile campaign, following Oracle's setup instructions and deploying their first app to Apple's XCode iPhone Simulator they hit this error message in the JDeveloper Log-Deployment window:

[01:36:46 PM] Deployment cancelled.
[01:36:46 PM] ----  Deployment incomplete  ----.
[01:36:46 PM] Failed to build the iOS application bundle.
[01:36:46 PM] Deployment failed due to one or more errors returned by '/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild'.  The following is a summary of the returned error(s):
Command-line execution failed (Return code: 69)

"Oh, return code 69, I know that well" I hear you say.  Admittedly the error code is less than useful besides drawing some titters from the peanut gallery.

Before explaining what's gone wrong, I think it's useful to teach customers how to diagnose these issues themselves. 

When ADF Mobile commences a deployment, be it to Apple's iOS or Google's Android platforms, JDeveloper and ADF Mobile do a good job in the Log window of showing you what the deployment process entails.  In the case of deploying to iOS the log window will literally include the XCode commands executed to complete the deployment cycle. As example here's the log output that was produced before the error message was raised.... take the opportunity to read this line by line and note the command line calls highlighted in blue:

(Note some of the following lines have been split over multiple lines to suit reading on this blog, each original line is preceded by a timestamp. Ensure to check the exact commands from JDev)

[01:36:33 PM] Target platform is (iOS).
[01:36:33 PM] Beginning deployment of ADF Mobile application 'LayoutDemo' to iOS using profile 'IOS_MOBILE_NATIVE_archive1'.
[01:36:34 PM] Command-line executed: [/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild, -version]
[01:36:34 PM] Command-line execution succeeded.
[01:36:34 PM] Running dependency analysis...
[01:36:34 PM] Building...
[01:36:34 PM] Deploying 3 profiles...
[01:36:35 PM] Wrote Archive Module to /Users/chris/fmw/jdeveloper/jdev/extensions/
oracle.adf.mobile/Samples/PublicSamples/LayoutDemo/ApplicationController/
deploy/ApplicationController.jar
[01:36:35 PM] WARNING: No Resource Catalog enabled ADF components found to package
[01:36:36 PM] Wrote Archive Module to /Users/chris/fmw/jdeveloper/jdev/extensions/
oracle.adf.mobile/Samples/PublicSamples/LayoutDemo/ViewController/
deploy/ViewController.jar
[01:36:36 PM] Verifying existence of the .adf source directory of the ADF Mobile application...
[01:36:36 PM] Verifying Application Controller project exists...
[01:36:36 PM] Verifying application dependencies...
[01:36:36 PM] The application may not function correctly because the following dependent libraries are missing: /Users/chris/jdev/jdeveloper/jdeveloper/jdev/extensions/oracle.adf.mobile/
lib/adfmf.springboard.jar
[01:36:36 PM] Verifying project dependencies...
[01:36:36 PM] Validating application XML files...
[01:36:36 PM] Validating XML files in project ApplicationController...
[01:36:36 PM] Validating XML files in project ViewController...
[01:36:40 PM] Copying common javascript files...
[01:36:41 PM] Copying FARs to the ADF Mobile Framework application...
[01:36:41 PM] Extracting Feature Archive file, "ApplicationController.jar" to
deployment folder, "ApplicationController".
[01:36:42 PM] Extracting Feature Archive file, "ViewController.jar" to
deployment folder, "ViewController".
[01:36:42 PM] Deploying skinning files...
[01:36:43 PM] Copying the CVM SDK files built for the x86 processor...
[01:36:43 PM] Copying the CVM JDK files built for the x86 processor...
[01:36:43 PM] Command-line executed: [cp, -R, -p,
/Users/chris/fmw/jdeveloper/jdev/extensions/oracle.adf.mobile/iOS/jvmti/x86/,
/Users/chris/fmw/jdeveloper/jdev/extensions/oracle.adf.mobile/
Samples/PublicSamples/
LayoutDemo/deploy/IOS_MOBILE_NATIVE_archive1/temporary_xcode_project/lib]
[01:36:43 PM] Command-line execution succeeded.
[01:36:43 PM] Command-line executed: [cp, -R, -p,
/Users/chris/fmw/jdeveloper/jdev/extensions/oracle.adf.mobile/iOS/jvmti/jar/,
/Users/chris/fmw/jdeveloper/jdev/extensions/oracle.adf.mobile/Samples/
PublicSamples/LayoutDemo/deploy/IOS_MOBILE_NATIVE_archive1/
temporary_xcode_project/lib]
[01:36:43 PM] Command-line execution succeeded.
[01:36:43 PM] Copying security related files to the ADF Mobile Framework application...
[01:36:44 PM] Command-line executed from path:
/Users/chris/fmw/jdeveloper/jdev/extensions/oracle.adf.mobile/Samples/
PublicSamples/LayoutDemo/deploy/IOS_MOBILE_NATIVE_archive1/temporary_xcode_project/
[01:36:44 PM] Command-line executed:
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild clean install
-configuration Debug -sdk
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/
Developer/SDKs/iPhoneSimulator6.1.sdk
DSTROOT=/Users/chris/fmw/jdeveloper/jdev/extensions/oracle.adf.mobile/Samples/
PublicSamples/LayoutDemo/deploy/IOS_MOBILE_NATIVE_archive1/Destination_Root/
IPHONEOS_DEPLOYMENT_TARGET=5.0 TARGETED_DEVICE_FAMILY=1,2
PRODUCT_NAME=LayoutDemo ADD_SETTINGS_BUNDLE=NO

As you can see when we move from JDeveloper undertaking its work, it then passes the code off in the last few lines for Apple's XCode to assemble and deploy the required .ipa file.  From the original error message which followed this complaining about xcodebuild failing with return code 69, we can quickly see the exact command line used to call xcodebuild.

As this is the exact command line call with all its options, you're free to open a Terminal window in Mac OSX and execute the same command by simply copying and pasting the command line. And via this you'll then find out what return code actually 69 means.  Unfortunately it's not that exciting.

For Macs that have just been installed and configured with XCode, XCode (and for that matter iTunes) which is required by ADF Mobile to deploy must have been run at least once before hand on your brand new Mac (to be clear that's once ever, not once every restart). On doing so you will be presented with a license agreement from Apple that you must accept. Only once you've done this will the command line calls work.  They're currently failing as you haven't accepted the legal terms and conditions. (arguably you an also accept the terms and conditions from the command line too, but ADF Mobile cannot do this on your behalf, so it's just easier to open the tools and confirm the legal requirements that way).

Putting aside the error code and its meaning, watching the log window, watching what commands are executed, learning what they do, this will assist you to diagnose issues yourself and solve these sort of issues more relatively quickly.  From my perspective as an Oracle Product Manager, it allows me to say "this is the stuff you don't need to worry about when you use ADF Mobile when it's configured correctly" .... as you can see my salesman qualities shine through.

For anyone who is happily using ADF Mobile on a Mac and wondering why you didn't hit these issues, it's quite likely that you already accepted the license conditions before deploying via ADF Mobile.  For instance, though I'm not a fan of iTunes itself, iTunes was one of the first things I loaded on my Mac to access my Justin Bieber albums.

Image courtesy of winnond / FreeDigitalPhotos.net

© Oracle Blogs or respective owner

Related posts about /Oracle