{"id":21997647,"url":"https://github.com/osfunapps/os-xcode-tools-py","last_synced_at":"2026-04-29T20:02:21.478Z","repository":{"id":57449674,"uuid":"192931929","full_name":"osfunapps/os-xcode-tools-py","owner":"osfunapps","description":"a bunch of tools for python xcode project development","archived":false,"fork":false,"pushed_at":"2021-02-07T14:21:28.000Z","size":13,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-28T23:50:28.248Z","etag":null,"topics":["apple","automation","ios","project","swift","xcode"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/osfunapps.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-06-20T14:11:02.000Z","updated_at":"2023-02-13T08:10:16.000Z","dependencies_parsed_at":"2022-09-14T10:51:18.411Z","dependency_job_id":null,"html_url":"https://github.com/osfunapps/os-xcode-tools-py","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osfunapps%2Fos-xcode-tools-py","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osfunapps%2Fos-xcode-tools-py/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osfunapps%2Fos-xcode-tools-py/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osfunapps%2Fos-xcode-tools-py/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/osfunapps","download_url":"https://codeload.github.com/osfunapps/os-xcode-tools-py/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245056902,"owners_count":20553854,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apple","automation","ios","project","swift","xcode"],"created_at":"2024-11-29T22:17:34.593Z","updated_at":"2026-04-29T20:02:11.454Z","avatar_url":"https://github.com/osfunapps.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Introduction\n------------\n\nThis module aim is to change properties of an xcode project (add files, directories, change plist files etc...)\n\n## Installation\nInstall via pip:\n\n    pip install os-xcode-tools\n\n\n## Usage       \nRequire XcodeProjectManipulator or PListFileHandler\n```python        \nimport os_xcode_tools.xcode_project_manipulator as xm\nimport os_xcode_tools.pl_list_file_handler as ph\n```\n\n## Functions and signatures:\n    \n# XcodeProjectManipulator\n```python    \ndef build_project(xcodeproj_path, pbxproj_path='project.pbxproj'):\n    \"\"\"\n    call this initially. Will create the project object to work with.\n\n    Args:\n        xcodeproj_path -\u003e the path to your xcodeproj file\n        pbxproj_path -\u003e the path to your pbxproj file (usually just project.pbxproj)\n    \"\"\"\n    return XcodeProject.load(xcodeproj_path + '/' + pbxproj_path)\n\n\n# will create a group. if already exists, return it\ndef get_or_create_group(project, path_to_group):\n    path = os.path.normpath(path_to_group)\n    splatted_path = path.split(os.sep)\n    last_group = None\n    for i in splatted_path:\n        last_group = project.get_or_create_group(i, parent=last_group)\n\n        # last_group = project.get_or_create_group(i)\n\n    return last_group\n    # parent = project.get_or_create_group(parent_name)\n    # return project.get_or_create_group(group_name, parent=parent)\n\n\n# will add the references of a file into a group\n# force = replace if exists\ndef add_file_to_group(project, file_path, group_obj, force=True):\n    project.add_file(file_path, force=force, parent=group_obj)\n\n\n# will add the references of files into a group\n# force = replace if exists\ndef add_arr_of_files_to_group(project, arr_of_files, group_obj, force=True):\n    for file_path in arr_of_files:\n        add_file_to_group(project, file_path, group_obj, force)\n\n\n# remove a whole group\ndef remove_group(project, group_name):\n    return project.remove_group_by_name(group_name)\n\n\ndef remove_file_from_group(project, group, file_name):\n    for f in group.children:\n        if f._get_comment() == file_name:\n            project.remove_file_by_id(f)\n\n\n# will remove all of the references of files from a given group\ndef clear_all_files_from_group(project, group_obj):\n    while True:\n        if len(group_obj.children) == 0:\n            project.save()\n            return\n        for file in group_obj.children:\n            project.remove_file_by_id(file)\n\n\n# will add the ability to inject these array of extensions (add .zip, .xml etc...)\ndef add_files_extensions_arr(extensions_arr):\n    for ext in extensions_arr:\n        ProjectFiles._FILE_TYPES[ext] = (ext[1:] + ext, u'PBXResourcesBuildPhase')\n\n\n# will change the bundle id\ndef change_bundle_identifier(project, new_bundle_id):\n    set_custom_flag(project, 'PRODUCT_BUNDLE_IDENTIFIER', new_bundle_id)\n\n\n# will set a custom flag to the project\ndef set_custom_flag(project, key, val):\n    project.set_flags(key, val)\n\n\n# will replace the info.plist file of the project.\n# do this if you want to change the display name of the current project, for example.\ndef replace_info_plist_file(old_info_file, new_info_file):\n    fh.copy_file(new_info_file, old_info_file)\n\n\n# save the changes in the project, otherwise your changes won't be picked up by Xcode\ndef save_changes(project):\n    project.save()\n```\n   \nAnd more...\n\n\n## Links\n[GitHub - osapps](https://github.com/osfunapps)\n\n## Licence\nISC","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosfunapps%2Fos-xcode-tools-py","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fosfunapps%2Fos-xcode-tools-py","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosfunapps%2Fos-xcode-tools-py/lists"}