I tried this script to copy release folder of one of my Xcode projects to desktop:
tell application "Finder"
set targetFolder to folder "release" of folder "build" of folder "8_15pm" of folder "26th_March" of folder "XYZ" of startup disk
set destinationFolder to folder "Desktop" of folder "miraaj" of folder "Users" of startup disk
copy targetFolder to destinationFolder
end tell
I was expecting that I will obtain a folder named as release on my desktop but I did not get any :(
Can anyone suggest me where I am wrong or some better way to do this??
Thanks,
Miraaj
change copy to duplicate
Related
when you new a group we can not find a real folder in the project,So we new a folder and add it as files to the project.But this time in Xcode7 I AddFileTo my project ,the folder is blue .
You are adding the folder as reference. when you add the folder, make sure you check "Create groups"....not "Create folder reference". See the following Screenshot.
I know how to move built .dlls to a folder using post-build events to copy the files, or using the output path setting.
Can I do something like that for all projects in a solution folder, where I wouldn't need to set up build events. I want all projects in a solution folder "SomeDir" to be moved to a "SomeDir" folder when built.
"SomeDir" would be the subfolder of the main output folder
Thanks
When you add a folder that contain subfolders and files to the Xcode project, the Xcode ask you about the folder option:
Create groups for any added folders.
Create folder references for any added folders.
I want to download the folder from a server. When the download is complete, the folder option will be 1 or 2? How can I set the folder option to option 2?
When Xcode references a folder, it uses whatever files are stored at that location on your local disk. If you download a new file to that folder or copy a file into that folder, it will show up in your Xcode project. If you change a file in that folder (by overwriting it in the Finder, or by using another app to download another copy of the file over the existing one), Xcode will use the new one.
I want to automatically add files to an Xcode project that is created from scratch (through another IDE) as a post-build step. Our project is set up to call an applescript that makes the appropriate file references in the project, but every attempt to add the file references to the project fails.
The core problem seems to be this error:
Xcode got an error: file reference id "DCDCC17E13819A8E004B4E75" of Xcode 3 group id "D82DCFB50E8000A5005D6AD8" of project "TestProject" of workspace document "project.xcworkspace" doesn’t understand the add message.
on this line:
add fileRef to first target of testProject
Where fileRef is the variable set to the newly-created file reference, and testProject is the variable set to the project containing the fileRef.
Here is the code:
on run argv
-- Get the folder containing items to be added to the project
tell application "Finder"
set thisScript to path to me
set projectFolder to get folder of thisScript as string
set sourceFolder to projectFolder & "FilesToAdd:"
end tell
-- Get all the files that will be added to Xcode
tell application "System Events"
set filesToAddList to the name of every disk item of (sourceFolder as alias)
end tell
tell application "Xcode"
-- Open the project using posix-style paths
open ((POSIX path of projectFolder) & "TestProject.xcodeproj")
-- Give Xcode some time to open the project before we start giving it commands
delay 1
set testProject to project "TestProject"
tell testProject
set sourceGroup to group "Sources"
tell sourceGroup
-- Iterate over all files in the list
repeat with i in filesToAddList
set fileName to (contents of i)
-- Get the file path using Unix-style pathing, since that is the kind that Xcode needs
set filePath to (POSIX path of sourceFolder) & fileName
-- Don't add duplicate file references
if filePath is not in path of file references in sourceGroup then
-- Add a new file reference to the project
set fileRef to make new file reference with properties {name:fileName, full path:filePath, path type:absolute, path:filePath, file encoding:macos roman}
-- Add the file reference to the build target
add fileRef to first target of testProject
end if
end repeat
end tell -- end group tell
end tell -- end project tell
end tell -- end app tell
end run
I've looked up other examples of adding files to targets, and it seems like this is the cleanest and concise way of doing it, and it seems to have worked for other people in the past. Is there a different way that file references are supposed to be added to targets?
For reference, I'm running OSX 10.6.7 and Xcode 4.0.2.
So I emailed Apple about this problem, and it turns out to be a bug. I've submitted a bug report, so hopefully this issue will get fixed soon.
Change this:
-- Add the file reference to the build target
add fileRef to first target of testProject
To this:
-- Add the file reference to the build target
tell application "Xcode"
add fileRef to first target of testProject
end tell
I need to store a folder in the package contents, not all files in the project all in one root folder.
How can I do this in XCode 4.0?
Right now I am going to the Build Phases > Copy Bundle Resources to attempt these changes.
Create your folder in the filesystem, then drag it to the resource folder in XCode. In the following dialog select create folder reference for any added folder. The folder should be blue. This folder is copied to your bundle with its contents.