Save the source code of an Xcode project (i.e., an iPhone app)
as a
.zip
file.
We can compress a folder and all of its contents into a
.zip
file by
right-clicking on the folder and selecting
Compress "Foldername".
The following instructions will let us be more selective
and compress only part of the folder’s contents
into a
.zip
file.
Let’s say your Xcode project is stored in a folder named
Hello
on your desktop.
We will copy it into a
zip
file.
Launch
Terminal.app
on your Mac
and type the following commands.
cd ~/Desktop pwd /Users/myname/Desktop
ls -ld Hello drwxr-xr-x 6 myname mygroup 204 Sep 9 14:20 Hello
Exclude the
build
directory from the
.zip
file.
Be sure to type the
'
single
quotes'
.
zip -r Hello.zip Hello -x 'Hello/build/*' adding: Hello/ (stored 0%) adding: Hello/.git/ (stored 0%) adding: Hello/.git/branches/ (stored 0%) adding: Hello/.git/COMMIT_EDITMSG (stored 0%) adding: Hello/.git/config (deflated 21%) adding: Hello/.git/description (deflated 14%) adding: Hello/.git/HEAD (stored 0%) adding: Hello/.git/hooks/ (stored 0%) adding: Hello/.git/hooks/applypatch-msg.sample (deflated 41%) adding: Hello/.git/hooks/commit-msg.sample (deflated 44%) adding: Hello/.git/hooks/post-commit.sample (deflated 24%) adding: Hello/.git/hooks/post-receive.sample (deflated 38%) adding: Hello/.git/hooks/post-update.sample (deflated 27%) adding: Hello/.git/hooks/pre-applypatch.sample (deflated 36%) adding: Hello/.git/hooks/pre-commit.sample (deflated 46%) adding: Hello/.git/hooks/pre-rebase.sample (deflated 59%) adding: Hello/.git/hooks/prepare-commit-msg.sample (deflated 46%) adding: Hello/.git/hooks/update.sample (deflated 68%) adding: Hello/.git/index (deflated 53%) adding: Hello/.git/info/ (stored 0%) adding: Hello/.git/info/exclude (deflated 28%) adding: Hello/.git/logs/ (stored 0%) adding: Hello/.git/logs/HEAD (deflated 28%) adding: Hello/.git/logs/refs/ (stored 0%) adding: Hello/.git/logs/refs/heads/ (stored 0%) adding: Hello/.git/logs/refs/heads/master (deflated 28%) adding: Hello/.git/objects/ (stored 0%) adding: Hello/.git/objects/01/ (stored 0%) adding: Hello/.git/objects/01/dd299c5738675bb47d8b80f4f8a097ed34e944 (stored 0%) adding: Hello/.git/objects/02/ (stored 0%) adding: Hello/.git/objects/02/37597b848a1890bb30ba0ff4102f8107cafdcb (stored 0%) adding: Hello/.git/objects/2c/ (stored 0%) adding: Hello/.git/objects/2c/9a50b54b9c718cc87b4973e53ed42d6fc8be47 (stored 0%) adding: Hello/.git/objects/2f/ (stored 0%) adding: Hello/.git/objects/2f/870300f20b139e5d851f85a7155a3ea0ba615e (stored 0%) adding: Hello/.git/objects/30/ (stored 0%) adding: Hello/.git/objects/30/8033b280a24bb5b81be441a7fb59763cbea6b6 (stored 0%) adding: Hello/.git/objects/45/ (stored 0%) adding: Hello/.git/objects/45/48b8728d7a8cb6136b1eb316acb212d964ebe7 (stored 0%) adding: Hello/.git/objects/46/ (stored 0%) adding: Hello/.git/objects/46/9a2f1a164e4d77a1eb58411b4b6c5158e080c5 (stored 0%) adding: Hello/.git/objects/47/ (stored 0%) adding: Hello/.git/objects/47/7b28ff8f86a3158a71c4934fbd3a2456717d7a (stored 0%) adding: Hello/.git/objects/64/ (stored 0%) adding: Hello/.git/objects/64/dca328772860d02a57d5847d378da9d5339511 (stored 0%) adding: Hello/.git/objects/77/ (stored 0%) adding: Hello/.git/objects/77/e6cfe22d8884eb577f368594619b3b86f7de99 (stored 0%) adding: Hello/.git/objects/7a/ (stored 0%) adding: Hello/.git/objects/7a/3bb4ea5feba41f19d2d2c15b648be5381d4dd1 (stored 0%) adding: Hello/.git/objects/7f/ (stored 0%) adding: Hello/.git/objects/7f/4d1daade863cb977f40b6f4c2372020e7e5fcb (stored 0%) adding: Hello/.git/objects/81/ (stored 0%) adding: Hello/.git/objects/81/f59d43c5feaea9948d63b7413b92c9cc9dc7dd (stored 0%) adding: Hello/.git/objects/95/ (stored 0%) adding: Hello/.git/objects/95/97c05e17c2813d3eeae653bf49bff44d4f987d (stored 0%) adding: Hello/.git/objects/ba/ (stored 0%) adding: Hello/.git/objects/ba/88b813f5bf7a0932e2ce5e909fecfc911f48af (stored 0%) adding: Hello/.git/objects/c0/ (stored 0%) adding: Hello/.git/objects/c0/a0e0312e6f95884c1bc1ee646ca8f83409f052 (stored 0%) adding: Hello/.git/objects/d3/ (stored 0%) adding: Hello/.git/objects/d3/d057af64d806a468b5898da6d06af375d07f62 (stored 0%) adding: Hello/.git/objects/d7/ (stored 0%) adding: Hello/.git/objects/d7/50d5bfd511d8abf2de45edc2d1d14893cec010 (stored 0%) adding: Hello/.git/objects/e1/ (stored 0%) adding: Hello/.git/objects/e1/3483d271236c22bd494a8d587d8c6a3e56228a (stored 0%) adding: Hello/.git/objects/fa/ (stored 0%) adding: Hello/.git/objects/fa/73ba5dc43cc8451ac51a4645d9c19dbb5a4597 (stored 0%) adding: Hello/.git/objects/fd/ (stored 0%) adding: Hello/.git/objects/fd/3271c2b995ead5820c81b03382677aad90eb86 (stored 0%) adding: Hello/.git/objects/info/ (stored 0%) adding: Hello/.git/objects/pack/ (stored 0%) adding: Hello/.git/refs/ (stored 0%) adding: Hello/.git/refs/heads/ (stored 0%) adding: Hello/.git/refs/heads/master (stored 0%) adding: Hello/.git/refs/tags/ (stored 0%) adding: Hello/Hello/ (stored 0%) adding: Hello/Hello/en.lproj/ (stored 0%) adding: Hello/Hello/en.lproj/InfoPlist.strings (stored 0%) adding: Hello/Hello/Hello-Info.plist (deflated 61%) adding: Hello/Hello/Hello-Prefix.pch (deflated 33%) adding: Hello/Hello/HelloAppDelegate.h (deflated 31%) adding: Hello/Hello/HelloAppDelegate.m (deflated 59%) adding: Hello/Hello/main.m (deflated 32%) adding: Hello/Hello/View.h (deflated 19%) adding: Hello/Hello/View.m (deflated 42%) adding: Hello/Hello.xcodeproj/ (stored 0%) adding: Hello/Hello.xcodeproj/project.pbxproj (deflated 84%) adding: Hello/Hello.xcodeproj/project.xcworkspace/ (stored 0%) adding: Hello/Hello.xcodeproj/project.xcworkspace/contents.xcworkspacedata (deflated 25%) adding: Hello/Hello.xcodeproj/project.xcworkspace/xcuserdata/ (stored 0%) adding: Hello/Hello.xcodeproj/project.xcworkspace/xcuserdata/nyuuser.xcuserdatad/ (stored 0%) adding: Hello/Hello.xcodeproj/project.xcworkspace/xcuserdata/nyuuser.xcuserdatad/UserInterfaceState.xcuserstate (deflated 95%) adding: Hello/Hello.xcodeproj/xcuserdata/ (stored 0%) adding: Hello/Hello.xcodeproj/xcuserdata/nyuuser.xcuserdatad/ (stored 0%) adding: Hello/Hello.xcodeproj/xcuserdata/nyuuser.xcuserdatad/xcschemes/ (stored 0%) adding: Hello/Hello.xcodeproj/xcuserdata/nyuuser.xcuserdatad/xcschemes/Hello.xcscheme (deflated 79%) adding: Hello/Hello.xcodeproj/xcuserdata/nyuuser.xcuserdatad/xcschemes/xcschememanagement.plist (deflated 49%) adding: Hello/HelloTests/ (stored 0%) adding: Hello/HelloTests/en.lproj/ (stored 0%) adding: Hello/HelloTests/en.lproj/InfoPlist.strings (stored 0%) adding: Hello/HelloTests/HelloTests-Info.plist (deflated 52%) adding: Hello/HelloTests/HelloTests-Prefix.pch (deflated 20%) adding: Hello/HelloTests/HelloTests.h (deflated 29%) adding: Hello/HelloTests/HelloTests.m (deflated 41%)
ls -l Hello.zip -rw-r--r-- 1 myname mygroup 54257 Sep 9 14:37 Hello.zip
See a list of all the folders and files in your
.zip
file.
The
-l
option is minus lowercase L.
unzip -l Hello.zip | more Archive: Hello.zip Length Date Time Name -------- ---- ---- ---- 0 09-09-11 14:20 Hello/ 0 09-09-11 14:37 Hello/.git/ 0 09-09-11 14:20 Hello/.git/branches/ 15 09-09-11 14:20 Hello/.git/COMMIT_EDITMSG 111 09-09-11 14:20 Hello/.git/config 73 09-09-11 14:20 Hello/.git/description 23 09-09-11 14:20 Hello/.git/HEAD 0 09-09-11 14:20 Hello/.git/hooks/ 452 09-09-11 14:20 Hello/.git/hooks/applypatch-msg.sample 896 09-09-11 14:20 Hello/.git/hooks/commit-msg.sample 160 09-09-11 14:20 Hello/.git/hooks/post-commit.sample 552 09-09-11 14:20 Hello/.git/hooks/post-receive.sample 189 09-09-11 14:20 Hello/.git/hooks/post-update.sample 398 09-09-11 14:20 Hello/.git/hooks/pre-applypatch.sample 1578 09-09-11 14:20 Hello/.git/hooks/pre-commit.sample 4951 09-09-11 14:20 Hello/.git/hooks/pre-rebase.sample 1239 09-09-11 14:20 Hello/.git/hooks/prepare-commit-msg.sample 3611 09-09-11 14:20 Hello/.git/hooks/update.sample 1288 09-09-11 14:30 Hello/.git/index 0 09-09-11 14:20 Hello/.git/info/ 240 09-09-11 14:20 Hello/.git/info/exclude 0 09-09-11 14:20 Hello/.git/logs/ 180 09-09-11 14:20 Hello/.git/logs/HEAD 0 09-09-11 14:20 Hello/.git/logs/refs/ 0 09-09-11 14:20 Hello/.git/logs/refs/heads/ 180 09-09-11 14:20 Hello/.git/logs/refs/heads/master 0 09-09-11 14:30 Hello/.git/objects/ 0 09-09-11 14:20 Hello/.git/objects/01/ 341 09-09-11 14:20 Hello/.git/objects/01/dd299c5738675bb47d8b80f4f8a097ed34e944 0 09-09-11 14:20 Hello/.git/objects/02/ 61 09-09-11 14:20 Hello/.git/objects/02/37597b848a1890bb30ba0ff4102f8107cafdcb 0 09-09-11 14:20 Hello/.git/objects/2c/ 271 09-09-11 14:20 Hello/.git/objects/2c/9a50b54b9c718cc87b4973e53ed42d6fc8be47 0 09-09-11 14:20 Hello/.git/objects/2f/ 147 09-09-11 14:20 Hello/.git/objects/2f/870300f20b139e5d851f85a7155a3ea0ba615e 0 09-09-11 14:30 Hello/.git/objects/30/ 356 09-09-11 14:30 Hello/.git/objects/30/8033b280a24bb5b81be441a7fb59763cbea6b6 0 09-09-11 14:20 Hello/.git/objects/45/ 186 09-09-11 14:20 Hello/.git/objects/45/48b8728d7a8cb6136b1eb316acb212d964ebe7 0 09-09-11 14:20 Hello/.git/objects/46/ 224 09-09-11 14:20 Hello/.git/objects/46/9a2f1a164e4d77a1eb58411b4b6c5158e080c5 0 09-09-11 14:20 Hello/.git/objects/47/ 61 09-09-11 14:20 Hello/.git/objects/47/7b28ff8f86a3158a71c4934fbd3a2456717d7a 0 09-09-11 14:20 Hello/.git/objects/64/ 112 09-09-11 14:20 Hello/.git/objects/64/dca328772860d02a57d5847d378da9d5339511 0 09-09-11 14:20 Hello/.git/objects/77/ 230 09-09-11 14:20 Hello/.git/objects/77/e6cfe22d8884eb577f368594619b3b86f7de99 0 09-09-11 14:20 Hello/.git/objects/7a/ 475 09-09-11 14:20 Hello/.git/objects/7a/3bb4ea5feba41f19d2d2c15b648be5381d4dd1 0 09-09-11 14:20 Hello/.git/objects/7f/ 182 09-09-11 14:20 Hello/.git/objects/7f/4d1daade863cb977f40b6f4c2372020e7e5fcb 0 09-09-11 14:20 Hello/.git/objects/81/ 58 09-09-11 14:20 Hello/.git/objects/81/f59d43c5feaea9948d63b7413b92c9cc9dc7dd 0 09-09-11 14:30 Hello/.git/objects/95/ 165 09-09-11 14:30 Hello/.git/objects/95/97c05e17c2813d3eeae653bf49bff44d4f987d 0 09-09-11 14:20 Hello/.git/objects/ba/ 228 09-09-11 14:20 Hello/.git/objects/ba/88b813f5bf7a0932e2ce5e909fecfc911f48af 0 09-09-11 14:20 Hello/.git/objects/c0/ 253 09-09-11 14:20 Hello/.git/objects/c0/a0e0312e6f95884c1bc1ee646ca8f83409f052 0 09-09-11 14:20 Hello/.git/objects/d3/ 1931 09-09-11 14:20 Hello/.git/objects/d3/d057af64d806a468b5898da6d06af375d07f62 0 09-09-11 14:20 Hello/.git/objects/d7/ 982 09-09-11 14:20 Hello/.git/objects/d7/50d5bfd511d8abf2de45edc2d1d14893cec010 0 09-09-11 14:20 Hello/.git/objects/e1/ 100 09-09-11 14:20 Hello/.git/objects/e1/3483d271236c22bd494a8d587d8c6a3e56228a 0 09-09-11 14:20 Hello/.git/objects/fa/ 135 09-09-11 14:20 Hello/.git/objects/fa/73ba5dc43cc8451ac51a4645d9c19dbb5a4597 0 09-09-11 14:20 Hello/.git/objects/fd/ 3249 09-09-11 14:20 Hello/.git/objects/fd/3271c2b995ead5820c81b03382677aad90eb86 0 09-09-11 14:20 Hello/.git/objects/info/ 0 09-09-11 14:20 Hello/.git/objects/pack/ 0 09-09-11 14:20 Hello/.git/refs/ 0 09-09-11 14:20 Hello/.git/refs/heads/ 41 09-09-11 14:20 Hello/.git/refs/heads/master 0 09-09-11 14:20 Hello/.git/refs/tags/ 0 09-09-11 14:36 Hello/Hello/ 0 09-09-11 14:22 Hello/Hello/en.lproj/ 45 09-09-11 14:20 Hello/Hello/en.lproj/InfoPlist.strings 1123 09-09-11 14:22 Hello/Hello/Hello-Info.plist 316 09-09-11 14:20 Hello/Hello/Hello-Prefix.pch 343 09-09-11 14:36 Hello/Hello/HelloAppDelegate.h 2496 09-09-11 14:36 Hello/Hello/HelloAppDelegate.m 364 09-09-11 14:36 Hello/Hello/main.m 184 09-09-11 14:36 Hello/Hello/View.h 774 09-09-11 14:36 Hello/Hello/View.m 0 09-09-11 14:30 Hello/Hello.xcodeproj/ 17695 09-09-11 14:30 Hello/Hello.xcodeproj/project.pbxproj 0 09-09-11 14:20 Hello/Hello.xcodeproj/project.xcworkspace/ 150 09-09-11 14:20 Hello/Hello.xcodeproj/project.xcworkspace/contents.xcworkspacedata 0 09-09-11 14:20 Hello/Hello.xcodeproj/project.xcworkspace/xcuserdata/ 0 09-09-11 14:37 Hello/Hello.xcodeproj/project.xcworkspace/xcuserdata/nyuuser.xcuserdatad/ 161250 09-09-11 14:37 Hello/Hello.xcodeproj/project.xcworkspace/xcuserdata/nyuuser.xcuserdatad/UserInterfaceState.xcuserstate 0 09-09-11 14:20 Hello/Hello.xcodeproj/xcuserdata/ 0 09-09-11 14:20 Hello/Hello.xcodeproj/xcuserdata/nyuuser.xcuserdatad/ 0 09-09-11 14:20 Hello/Hello.xcodeproj/xcuserdata/nyuuser.xcuserdatad/xcschemes/ 3117 09-09-11 14:20 Hello/Hello.xcodeproj/xcuserdata/nyuuser.xcuserdatad/xcschemes/Hello.xcscheme 567 09-09-11 14:20 Hello/Hello.xcodeproj/xcuserdata/nyuuser.xcuserdatad/xcschemes/xcschememanagement.plist 0 09-09-11 14:20 Hello/HelloTests/ 0 09-09-11 14:20 Hello/HelloTests/en.lproj/ 45 09-09-11 14:20 Hello/HelloTests/en.lproj/InfoPlist.strings 683 09-09-11 14:20 Hello/HelloTests/HelloTests-Info.plist 151 09-09-11 14:20 Hello/HelloTests/HelloTests-Prefix.pch 238 09-09-11 14:20 Hello/HelloTests/HelloTests.h 429 09-09-11 14:20 Hello/HelloTests/HelloTests.m -------- ------- 215894 104 files