Showing posts with label Xcode. Show all posts
Showing posts with label Xcode. Show all posts

Friday, July 1, 2011

Add non-admin users to Developer Tools group on Mac

[Source: http://idtechnology.blogspot.com/2010/10/add-user-to-developer-tools-group.html]

To add a user to “Developer Tools” group:
dseditgroup -o edit -u {admin_user} -t user -a {user_name} _developer

Thursday, April 29, 2010

Code Sign Error after reinstalling provisioning profile

Sometimes Xcode project file easily gets messed up. For example, when I try to rebuild my application that worked well with my previous provisioning file yesterday, however I reinstall my provisioning file today. In this case, following error message can be show up;

"Code Sign Error: Provisioning Profile (long string) can't be found."

Here is an easy solution.

1) Open the project file in a text editor:
The .xcodeproj file is actually not a file but a directory, like an application bundle. So, you can right click it in Finder to open. Then, select "package contents". Now, you will see several files. The actual project file is "project.pbxproj". Open it in a text editor.

2) Search provisioning profile setting and manually erase the lines. Save the project file:
They will look like these;
PROVISIONING_PROFILE = "xxxxxx.....xxxxx";
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "xxxxxx.....xxxxx";

3) Reopen the project in Xcode and go to the settings to reselect your new provisioning profile.

Wednesday, January 20, 2010

Universal C/C++ Static Library for iPhone simulator and device using Xcode

In my previous post, I googled many articles to create universal static library by using shell script. However, here is a simple and easy way to create universal static library that can be used for both iPhone Simulator and device.

How to create universal C/C++ static library using Xcode
1. Create a new project using Xcode: iPhone OS->Application->OpenGL ES Application using Xcode (e.g., MathFuncsLib)
2. Delete all files from Classes
3. Delete "main.m" from Other Sources
4. Delete the current target "MathFuncsLib"
5. Create new static library target "MathFuncsLib"
6. Add your header (e.g., MathFuncsLib.h) and source (e.g., MathFuncsLib.cpp) files for MathFuncsLib into in Classes
7. Select active SDK: Simulator - your SDK version and Build (library file for x86 architecture)
8. Select active SDK: Device - your SDK version and Build (library file for arm architecture)
9. Find library files for each architecture under a build folder and change their file name appropriately. For example "MathFuncsLib-x86.a" and "MathFuncsLib-arm.a"
10. Copy them into any same folder
11. Create universal static library by running "lipo MathFuncsLib-x86.a MathFuncsLib-arm.a -create -output libMathFuncsLib-fat.a" in Terminal

How to use universal C/C++ static library in your iPhone application
1. Create your iPhone application
2. Open Info for Target, and on Build tab, add your library name for Linking->Other Linker Flags (you should use this format: -l[your library name]. In my case, -lMathFuncsLib-fat)
3. If you create separate folders for library such as "Include" for header files and "Lib" for library file, add them for Search Paths->Header Search Paths and Library Search Paths on the Build tab
4. Import header file for library in your application (e.g., #import "MathFuncsLib/MathFuncsLib.h")
5. Build and Go application
6. If you want to look at your application on iPhone device, you also need to follow the instruction to install your application on device by using "Apple Developer Program"

Thursday, January 14, 2010

How to copy iPhone Application Data to Mac computer

1) Navigate to the app on your phone via the XCode Organizer.

2) Click the triangle on the left of your app's name to show the "Application Data" field.

3) Press the down arrow on the right side of that to download it.

4) Save the application data into your local folder.
--> "Document", "Library", and "tmp" folders will be saved.