xcodebuild + iPhone fail under ssh with Couldn't load plug-in 'com.apple.Xcode.iPhoneSupport' - iphone-sdk-3.0

I'm triying to compile my iPhone app from ssh. This is for my build tool that run in another machine.
The base sdk is iPhone Device 3.0.
The error is : "Couldn't load plug-in 'com.apple.Xcode.iPhoneSupport'"
However, executing from the regular terminal run ok. Also directly from xcode.
This is the log:
[trtrrtrtr#mac-pro-de-trtrr-trtr ~/mamcx/projects/JhonSell/iPhone]$ xcodebuild -target BestSeller -configuration Debug=== BUILDING NATIVE TARGET Three20 OF PROJECT Three20 WITH CONFIGURATION Debug ===
Checking Dependencies...
No architectures to compile for (ONLY_ACTIVE_ARCH=YES, active arch=armv6, VALID_ARCHS=i386).
2010-04-27 16:16:50.369 xcodebuild[1168:4b1b] Error loading /Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Plug-ins/iPhoneRemoteDevice.xcodeplugin/Contents/MacOS/iPhoneRemoteDevice: dlopen(/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Plug-ins/iPhoneRemoteDevice.xcodeplugin/Contents/MacOS/iPhoneRemoteDevice, 265): no suitable image found. Did find:
/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Plug-ins/iPhoneRemoteDevice.xcodeplugin/Contents/MacOS/iPhoneRemoteDevice: GC capability mismatch
2010-04-27 16:16:50.371 xcodebuild[1168:4b1b] Exception caught: Couldn't load plug-in 'com.apple.Xcode.iPhoneSupport'
2010-04-27 16:16:50.373 xcodebuild[1168:4b1b] Error loading /Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Plug-ins/iPhoneRemoteDevice.xcodeplugin/Contents/MacOS/iPhoneRemoteDevice: dlopen(/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Plug-ins/iPhoneRemoteDevice.xcodeplugin/Contents/MacOS/iPhoneRemoteDevice, 265): no suitable image found. Did find:
/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Plug-ins/iPhoneRemoteDevice.xcodeplugin/Contents/MacOS/iPhoneRemoteDevice: GC capability mismatch
2010-04-27 16:16:50.373 xcodebuild[1168:4b1b] Exception caught: Couldn't load plug-in 'com.apple.Xcode.iPhoneSupport'
** BUILD FAILED **

If it runs fine under Xcode and terminal on the same machine then it is probably a permissions problem with the user in ssh.

It seems to be a problem in the XCode project. See the following line:
No architectures to compile for (ONLY_ACTIVE_ARCH=YES, active arch=armv6, VALID_ARCHS=i386).
It indicates that:
You enabled the "Build Active Architecture Only" checkbox in the "BestSeller" target.
You only have "armv6" as active architecture, whereas the only valid architectures are "i386".
I suggest you to check that these options are correctly defined under XCode. Then, you can go these ways:
perform a build under the XCode GUI.
perform a build on the command line.
on the local machine, use ssh to connect and perform a build on the command line.
on the remote machine, use ssh to connect and perform a build on the command line.
For each attempt, save the output and compare them. Maybe the architecture problem is not the only one, but by doing it by steps it will be easier to spot the problem.

Related

Wrong team/provisionning profile when using xcodebuild command

I'm trying to build a continuous integration's script on my xcode project, but I'm stuck trying to archive my xcode project using xcodebuild command. When trying :
sudo xcodebuild -scheme MyScheme -archivePath builds/XXX.xcarchive archive DEVELOPMENT_TEAM=YYY CODE_SIGN_IDENTITY='iPhone Distribution' CODE_SIGN_STYLE='Manual' PROVISIONING_PROFILE_SPECIFIER=ZZZ
XXX is my project name
YYY is my development team identifier, like ABC123DEF, it's a string
ZZZ is my provisionning profile name, not a code but a string, like "My Provisionning Profile"
I always get this error :
error: No profile for team 'YYY' matching 'ZZZ' found: Xcode couldn't find any provisioning profiles matching 'YYY/ZZZ'. Install the profile (by dragging and dropping it onto Xcode's dock item) or select a different one in the General tab of the target editor.
However, when opening manually the XCode project and trying to archive, it works perfectly.
What am I missing? How can I get the full list of team/provisionning_profile installed on my Mac?
What I have tried so far :
I tried to remove the part where I specify the development team and provisionning profile, leaving only the scheme identifier. Same result considering the scheme is defined with the same informations.
I tried to go in my mobileprovision folder to check if the provisionning profile exists (it exists)
I tried to display the xcode archive command lines in the editor (On the Report navigator tab). Actually it never shows the xcodebuild command directly but a bunch of subcommands. However I could find out that my XXX team identifier and YYY provisionning profile that I am using are using in this script
Does anyone know how I can solve this issue?
I finally found the problem, it came from the sudo before xcodebuild.
The sudo command will run the following action under the root user by default, which doesn't have any provisioning profile installed, as I always registered them under my user profile.
here is what I did :
sudo -u myuser xcodebuild -scheme MyScheme -archivePath builds/XXX.xcarchive archive DEVELOPMENT_TEAM=YYY CODE_SIGN_IDENTITY='iPhone Distribution' CODE_SIGN_STYLE='Manual' PROVISIONING_PROFILE_SPECIFIER=ZZZ
and the error disappeared.
Hope this can help someone.
Provisioning profiles are in ~/Library/MobileDevice/Provisioning Profiles/
You could add -allowProvisioningUpdates to allow xcodebuild to "solve" the problem itself, but... ¯_(ツ)_/¯ for how safe/good the result will be. You've specified "manual" so I assume you don't want to do this.
I suspect you are trying to archive the project but only have a development profile installed. Build a Release build of the project from within Xcode and that should get it to download a release (distribution) provisioning profile for you which you can then use from the command line.

Mobilefirst target run time error

Trying to run a hybrid application and receive the following error:
target run times HTTP preview is not defined
Any advice?
You needn't touch the project properties > Target runtimes.
I suggest for you to either:
Start a new workspace, or
Delete the your-workspace\MobileFirstConfigServer folder.
This should resolve the error you're facing, by restoring the project to its default settings.

Archived App not working. Run from XCODE successful

I have made an app with swift which is working when I run it from XCODE. However, when i try to archive it and run the .app, it will not start.
How can I check why the app is crashing/not starting? What can be the reasons?
This is what the console output if I enter the packe and start it from the folder Contents/MACOs
Mislavs-MBP:~ proslav$ /Users/proslav/Desktop/trackingCore.app/Contents/MacOS
/trackingCore ; exit;
dyld: Library not loaded: #rpath/SQLite.framework/Versions/A/SQLite
Referenced from: /Users/proslav/Desktop/trackingCore.app/Contents/MacOS
/trackingCore
Reason: image not found
Trace/BPT trap: 5
logout
running it from the terminal gives the following output
LSOpenURLsWithRole() failed with error -10810 for the file /Users/proslav
/Desktop/trackingCore.app.
I have added a framework https://github.com/stephencelis/SQLite.swift to access a SQLite database. That is the library that is not loaded although it exists in the .app
I found the answer. In the copy files i was linking to resources instead of frameworks. It seemed to be no problem for run but it was for archving.
Anyone arriving here based on the title, note that Xcode OSx builds are broken now.
https://developer.apple.com/library/mac/qa/qa1884/_index.html
They recommend using command line tools;
$ productbuild --component Sample.app /Applications --sign “3rd Party Mac Developer Installer:" Sample.pkg
$ sudo installer -store -pkg Sample.pkg -target /

iOS: XCode 4.4.1: xcodebuild error - Unable to read diagnostics from file

So I would like to use xcodebuild in Terminal to create a build from a test application (called RunTeszt1). The app is an iOS single view application with nothing in it, just created and closed.
When I this from the Terminal, the build fails.
xcodebuild -target "RunTeszt1" -sdk "$iphoneos5" -configuration Debug
The error is:
Unable to read diagnostics from file "/var/folders/6s/cjw35hhs5lb6wpnx9m8lr2km0000gn/C/com.apple.Xcode.501/SharedPrecompiledHeaders/RunTeszt1-Prefix-eqntxoxxhhlzvieuipqbxfumbpxb/RunTeszt1-Prefix.pch.dia" (Invalid File): Bad header in diagnostics file
Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide.
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1
When I run the app from XCode (4.4.1), the build completes and everything is ok. However, If I run the Console app and inspect the results after hitting build button in XCode, I see the same error message in the console. Nevertheless the build succeeds and opens the simulator.
Is this really a bug in xcodebuild which should be sent to apple? If it is I imagine a bunch of people already sent it.
How can I either make the error go away, or stop it from cancelling the building process, so circumvent it like XCode does?
Turns out the problem was code signing. Even though I put Don't code sign in the build settings, it still hanged up on it. Also it seems "-sdk xxx" was also at fault (no matter what sdk I specified).
Running this command resulted in a successful build:
xcodebuild clean build CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -target RunTeszt2

Command /usr/bin/lipo failed with exit code 1 error

I have finally finished my app and I was getting ready to upload when this sudden error hit me and I have no idea what to do. I have checked other posts saying to change the code signing identity and I have done this but no luck. I tried every single option in the identity and no change. If anyone knows what is going on I would really appreciate it since I would simply just like to submit my app.
Here is what else it says in the erorr log:
/usr/bin/lipo: /Users/teddy/Library/Developer/Xcode/DerivedData/grocery_stores-dcyubhefhrcjhtcxbhldfpukdgdz/Build/Intermediates/grocery stores.build/Release-iphoneos/grocerystores.build/Objects-normal/armv7/grocery stores and /Users/teddy/Library/Developer/Xcode/DerivedData/grocery_stores-dcyubhefhrcjhtcxbhldfpukdgdz/Build/Intermediates/grocery stores.build/Release-iphoneos/grocery stores.build/Objects-normal/armv7/grocery stores have the same architectures (armv7) and can't be in the same fat output file
Command /usr/bin/lipo failed with exit code 1
I solved this issue by changing the value of the Valid Architecture found in Project > Build Settings > Architectures from the default "armv6 armv7" to "armv7". Hope this helps.
It's hard to see what exactly is happening without the command you are running. It looks to me like you are specifying the same input file twice, namely the arm7 version and lipo is telling you you can't add 2 arm7 versions of grocery stores to the universal file. Can you please enter the entire lipo command you are running? From the lipo man page:
-create
Take the input files (or file) and create one universal output file from them.
Do you possibly have the same file listed twice here?
Try changing your build target to a simulator build, clean and re-run.
In my case I used pods and oped projectFile instead of project workspace
In my case it was building a project on simulator in a release scheme, changed it to debug and it worked.