Question

I need to create a simulator build in order to submit my app to facebook team for further review of my open graph.

They have a instruction to create that here facebook instruction

But I use cocoapods and I can not make this build. everytime it gives me error.

Était-ce utile?

La solution

xcodebuild -arch i386 -sdk iphonesimulator{version} -workspace [projectName].xcworkspace -scheme [projectName]

Follow the steps Click here

Autres conseils

Here is the another easy method to create .zip file

  • Step 1: open finder and press command⌘ + shift⇧ + g
  • Step 2: paste "~/Library/Developer/Xcode/DerivedData"
  • Step 3: select your_app_name-jkfksdfhskdhfksdh some thing like this folder
  • Step 4: your_app_name-jkfksdfhskdhfksdh >>Build>>Products>>Debug-iphonesimulator

  • Step 5: You will see 2 files one is your_app_name.app(icon like rounder and 1 cross line ) and 2nd file is your_app_name.app.dSYM

  • Step 6: To create .zip file right click on your_app_name.app and select "Compress your_app_name". It will generate .zip file and submit it to facebook.

I'm in the same boat and have been struggling with this!

I managed to get my build working by adding the following to the command line args:

-workspace [Name.xcworkspace] -Scheme [NameOfScheme]

I also had to edit the scheme and add the Pods target explicitly as it was failing the build with Library not found for -lPods.

Having the same issue, I had both errors fixed @bean his error by adding 'i386' to the "valid architectures" in build settings. (for my app target, pod target and every pod separately)

My full build command is:

xcodebuild -workspace [projectName].xcworkspace -scheme [schemeName] -arch i386 -sdk=iphonesimulator7.1

I can complete the build but I get tons warnings:

warning: no rule to process file '[any .m file]' of type sourcecode.c.objc for architecture i386

I have no idea how to fix this, an .app file is created just not on the location the facebook tutorial says it should be (its in "~/Library/Developer/Xcode/DerivedData/.." instead of "{projectDir}/build/...")

Now 2 questions remain for me:

1.) How can I test or this .app file works (double-clicking it tells me the file is damaged.)

2.) (Why) Can I not just build the app from within Xcode using the simulator and just submit the .app file that Xcode created?

Facebook updated its guidelines how to make a simulator built (link)

  1. Run your app in your Xcode iPhone 5 simulator. This automatically creates a simulator build in Xcode's DerivedData cache.

  2. Run: ditto -ck --sequesterRsrc --keepParent ls -1 -d -t ~/Library/Developer/Xcode/DerivedData/*/Build/Products/*-iphonesimulator/*.app | head -n 1 path/to/YourApp.zip This automatically zips the simulator build.

  3. You can verify the simulator build by using the ios-sim utility Command-line App Launcher for Simulator.

  4. Submit YourApp.zip.

it's simple as going to ~/Library/Developer/Xcode/DerivedData//Build/Products/-iphonesimulator/XXXX.app copy you XXXX.app from there and copy to desktop ..right click and select compress.. you will a zip file for your app.Submit it to fB

Developers who has failed with @Pradip Vanparia's Solution like me this will work:

xcodebuild -workspace {project name}.xcworkspace -scheme {project name}  -arch i386 -sdk iphonesimulator9.3

And I found iphonesimulator9.3 by following command:

xcodebuild -showsdks

The just "Copy/Past" way :

ditto -ck --sequesterRsrc --keepParent `ls -1 -d -t ~/Library/Developer/Xcode/DerivedData/*/Build/Products/*-iphonesimulator/*.app | head -n 1` MyApp.zip
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top