View Full Version : [FIXED] Adhoc builds do not work

5 Dec 2011, 10:46 AM
I stupidly posted this on the Ext.js 2.x bugs forums, so I'm manually moving it over to here.

I'm trying to build with adhoc certs so I can send my app around to clients and testers and I keep getting "Invalid IPA: missing embedded provisioning profile. Are you sure this is an ad hoc?".

The profile is adhoc and I can successfully run the build on my device, but inspecting the .app bundle it doesn't look like the embedded.mobileprovisioning profile exists. I'm able to partially work around this problem by copying my mobile provisioning profile used for signing into .app/embedded.mobileprovisioning. So far I've been able to upload to testflightapp and install on my own machine, though I'm not yet sure if my testers have been able to install. If this fails my next attempt will be to use xcrun (see http://nachbaur.com/blog/building-ios-apps-for-over-the-air-adhoc-distribution) to generate the ipa instead of doing it manually:

xcrun -sdk iphoneos PackageApplication \
"path/to/build/MyApp.app" \
-o "output/path/to/MyApp.ipa" \
--sign "iPhone Distribution: My Company" \
--embed "path/to/something.mobileprovision"

It's also worth mentioning that the "versionString" has no effect, as my app still shows as v1.0 in testflightapp.

Also I've been completely unable to get a splash screen to work or remove the gloss from the icon. I've tried adding the following into my config.json and into my setup hoping it'd work:

"phoneStartupScreen": "Default.png",
"glossOnIcon": false

I've also placed a Default.png in every directory because somebody mentioned on the forums that the fix was to place it in the root, but this has no effect on sencha from what I've seen. I've even tried to drop it into the .app but obviously that invalidates the signature.

Any ideas on workarounds for any of these?

5 Dec 2011, 10:47 AM
Embedding the provisioning profile manually did not work. Testflightapp indeed let me upload the binary, but all of my testers are getting:

"You have not permitted this device to install this build. This device is not included in the build's provisioning profile."

It did let me install the app on my device via TFP, so maybe it's not my adhoc profile that I should copy over verbatim.

Here's my config.json for reference:

"phoneStartupScreen": "webapp/Default.png",
"glossOnIcon": false,
"certificateAlias":"iPhone Distribution: My Name",
"orientations": ["portrait"]

Jamie Avins
5 Dec 2011, 11:02 AM
Thank you for the report.

5 Dec 2011, 4:06 PM
I haven't yet produced an adhoc build that runs on more than 1 device, but I did come across some work arounds to remove gloss from the dock icon and adding in a Default.png.

It turns out you can resign the app once it's produced, so after running the sencha packager, simply drop a Default.png into the root of the produced .app, and then edit .app/Info.plist and add (inside the <dict> tags)

<true />

Once you've done this you simply need to resign your app like so:

codesign -f -vv -s "iPhone Distribution: You" "YourApp.app"

This will prompt you to resign your app using keychain, allow it.

After this step you can run the following command to verify that your app is usable:

codesign -dvvv YourApp.app

If this command prints out settings you should be all good. You can now produce an ipa that will have no gloss on the home icon and a splash screen. The splash screen only covers up the black screen on startup, and a white screen still appears for a few seconds, but I'm thinking at this point I'm rendering html so I could probably just place an img tag with the splash in my html to cover that bit up too.

I'm also thinking I should be able to drop the embedded.mobileprovision I need into the .app and resign it and I could probably get around the adhoc issue this way. I'm still working on generating that file. I thought it was simply my adhoc provisioning profile exported but apparently it's not.

I'll post an update when I have made more progress.

5 Dec 2011, 11:05 PM
OK, With the following you should be able to generate an adhoc ipa that is suitable for distribution. Ostensibly this will also work on Testflightapp as well as it let me submit the ipa and then presented me with a list of users/devices to choose from that were in the embedded profile. My testers are all sleeping right now but I'll confirm either way once I know for sure. So far it's looking much more promising though.

For the purpose of this doc, everything is relative to ~/builds.

To start, use sencha package to generate your .app file and move this .app bundle to ~/builds.

1. Open xcode
2. window -> organizer
3. click provisioning profiles in the left pane
4. select your adhoc provisioning profile
5. click export and save this as embedded.mobileprovision in ~/builds

$ rm -r MyApp.app/_CodeSignature MyApp.app/CodeResources
$ cp embedded.mobileprovision MyApp.app/
$ codesign -f -vv -s "iPhone Distribution: Your Name" "MyApp.app"

You should be prompted a few times to use your keychain, allow this. If it works you'll see something like this print out:

MyApp.app: replacing existing signature
MyApp.app: signed bundle with Mach-O universal (armv6 armv7) [com.whatever.myapp]

If you want, package it as an ipa:

$ mkdir Payload
$ mv MyApp.app $_
$ zip -r MyApp.ipa Payload

Also, one last quick note.. I was able to get rid of the initial white screen by adding my splash screen as an image in the html and then simply hiding it when my Main view loads. I choose to use the painted listener because onReady and launch fire as soon as my first splash screen ends. Here's the relevant code:


<img src="Default.png" id="splash-screen" />

Your main js view (in my case app/view/Main.js):

Ext.define('MyApp.view.Main', {
extend: 'Ext.TabPanel',
requires: [ /* ... */ ],
config: { /* ... */ },

initialize : function() {
scope: this,
painted: this.onPaint,

onPaint: function() {

Now (if you also used the workaround in the above post) both the initial black and white startup screens should be replaced with Default.png which will stay on screen until your main components render. Gave my app a much more manageable feel (even though I have 15 second initial startups lol..)

6 Dec 2011, 9:01 AM
I woke up this morning and checked testflightapp and indeed it shows that 2 of my testers were able to successfully install, so the above info worked for me.

16 Jul 2012, 12:19 PM
we've added new key to configuration "provisionProfile":"path_to.mobileprovision" with it it should work fine