TiShadow ํ์ฉ๋ฐฉ๋ฒ
TiShadow?
TiShadow๋ฅผ ์ฌ์ฉํ๋ฉด ์ฑ์ ๊ฐ๋ฐ์ ์ฌ๋ฌ ๋๋ฐ์ด์ค๋ ์๋ฎฌ๋ ์ดํฐ์ ๋น ๋ฅด๊ฒ ์ฑ์ ์คํ ์ํฌ ์ ์๋ค. ์ด๋ป๊ฒ ๋น ๋ฅด๊ฒ ์คํํ๋ ๊ฒ์ผ๊น? ๊ธฐ๋ณธ ๋ฐฉ๋ฒ๊ณผ tishadow ๋ฐฉ๋ฒ์ ๋ํ ์ค๋ช ์ผ๋ก ๋น๊ตํ๊ฒ ๋ค.
๊ธฐ์กด ์คํ ๋ฐฉ๋ฒ : ์ฑ์ ๊ฐ๋ฐํ ๋ ์ฑ์ ๋๋ฐ์ด์ค์ ์คํํ๋ ค๋ฉด ํด๋น ์ฑ์ ํด๋นํ๋ native ํ๋ก์ ํธ๋ฅผ ๋น๋ํด์ ์ฑํ์ผ์ ์์ฑ(ipa, apk)ํ๊ณ ์ด ํ์ผ์ ๋๋ฐ์ด์ค๋ก ์ฎ๊ธฐ๊ฒ ๋๋ค. ์ฌ๊ธฐ์ ํ๋ก์ ํธ ๋น๋ ์๊ฐ์ด ์ค๋ ๊ฑธ๋ฆฐ๋ค.1
TiShadow์ ์คํ ๋ฐฉ๋ฒ : TiShadow๋ Titanium์ผ๋ก ๊ฐ๋ฐ๋ app๋ค์ javascript ์ฝ๋๋ฅผ runtime์ ์คํํ๋ค๋ ํน์ง์ ์ด๋ ค์ ๋ณ๊ฒฝ๋ ์ฝ๋(Resource)๋ฅผ ๋คํธ์ํฌ(์์ผ)์ ํตํด ์ ์กํ๊ณ ๋ค์ app.js ๋ถํฐ ๋ค์ ์์ํ๋ ์๋ฆฌ์ด๋ค. ๊ทธ๋ฌ๋ฏ๋ก ๋ค์ ๋ค์ดํฐ๋ธ ์ฝ๋๋ฅผ ๋น๋ํ๊ฑฐ๋ ์ฑ ํ์ผ(ipa,apk)๋ฅผ ์ ์กํ๊ฑฐ๋ ํ๊ณ ์ฌ์ง์ด ์ฑ๋ ์ข ๋ฃ ๋๋ ๊ฒ์ด ์๋๋ผ ์ฑ์ด ์ผ์ง์ํ์์ app.js๋ฅผ ๋ค์ ์คํํ๋ค.2
์ค์น๋ฐฉ๋ฒ ๋ฐ ๊ธฐ๋ณธ ์ฌ์ฉ๋ฒ
์ค์น ๋ฐฉ๋ฒ์ TiShadow Github๋ฐ ํ์ดํ๋ ๊ฐ๋ฐ์ ์ปค๋ฎค๋ํฐ์ ์ ์์ ๋ ๊ธ์ ์ ์ค๋ช ๋์ด ์๋ค.
Room
room์ ํ๋์ tishadow ์๋ฒ๋ฅผ ์ฌ๋ฌ ๋ฐฉ์ผ๋ก ๋๋์ด์ ์ฌ๋ฌ ์ฑ์ด๋ ํ๋ซํผ ๋๋์๊ฐ ์ฌ๋ฌ ๊ฐ๋ฐ์๋ค์ด ๋์์ ์ฌ์ฉ๊ฐ๋ฅํ๋ค๋ก ํด์ฃผ๋ ๊ธฐ๋ฅ์ด๋ค. ๊ฐ์ธ์ ์ผ๋ก ์ด room์ ์ฌ์ฉํ๋ ๊ฒฝ์ฐ๋ alloyํ๋ก์ ํธ๋ฅผ iOS, Android ๋์์ผ๋ก ๋์์ ๊ฐ๋ฐํ ๋์ด๋ค. ์ด๋ room์ ์ฌ์ฉํ์ง ์์ ๊ฒฝ์ฐ ๋ค์๊ณผ ๊ฐ์ ๋ฌธ์ ๊ฐ ์๋ค. tishadow์๋ฒ์ ์์ดํฐ ์๋๋ก์ด๋ ์ ๋ถ ์ฐ๊ฒฐ๋์ด ์๋ ์ํ์์ iOS์์ ํ์ธํ๊ธฐ ์ํด alloy compile -c platform=ios && tishadow run ์คํํ๋ฉด android ํฐ์๊น์ง iOS์ฉ์ผ๋ก ์ปดํ์ผ๋ ์ฝ๋๊ฐ ์ ๋ฌ๋์ด ์คํ๋ ๋ฒ๋ฆฌ๋ ๋ฌธ์ ๋ฐ์ํ๋ค. ๊ทธ ์ด์ ๋ Alloy์์ tss๋ xml์์ platform3 ์์ฑ์ด๋ js์์ OS_IOS, OS_ANDROID ๋ณ์4๋ฅผ ์ด์ฉํ์ฌ ํ๋ซํผ์ ๋ฐ๋ผ ๋ค๋ฅด๊ฒ ๊ฐ๋ฐ ํ์ ๋ alloy compile์ ์ง์ ๋ ํ๋ซํผ์ ๋ฐ๋ผ ํด๋น ์ฝ๋๊ฐ ์ต์ ํ ๋์ด resourceํ์ผ์๋ ์กฐ๊ฑด๋ฌธ์ ์ฌ๋ผ์ง๊ณ ์กฐ๊ฑด์ ๊ฒฐ๊ณผ์ ๋ฐ๋ฅธ ์ฝ๋๋ง ์กด์ฌํ๊ธฐ ๋๋ฌธ์ด๋ค. ๋ค์๋งํด alloy compile์ ํน์ ํ๋ซํผ์ ์ํ ์ต์ ํ ์ฝ๋๋ฅผ ์์ฑํ๊ฒ ๋๋ค. ์ด ๋ฌธ์ ๋ room์ ์ฌ์ฉํ๋ฉด ๋๋ค.
tishadow server ๋ฅผ ์คํํ๋ค.
์์ดํฐ์์ tishadow app์ connect ํ ๋ advanced๋ฅผ ์ ํํ๊ณ room ์ด๋ฆ์ ios๋ผ๊ณ ์ ๋ ฅํ๊ณ connect ํ๋ค.
์๋๋ก์ด๋ํฐ์์ tishadow app์ connect ํ ๋ advanced๋ฅผ ์ ํํ๊ณ room ์ด๋ฆ์ android๋ผ๊ณ ์ ๋ ฅํ๊ณ connect ํ๋ค.
alloy ํ๋ก์ ํธ์์ ๋ค์๊ณผ ๊ฐ์ด ์คํํ๋ค.: alloy compile -c platform=android && tishadow run -r android && alloy compile -c platform=ios && tishadow run -r ios
์๋๋ก์ด๋ ์์ดํฐ ๋ชจ๋ ๊ฐ์์ ์ฝ๋๋ก ์คํ์ด ๋๋ค.
Appify
TiShadow app์ ํตํด์๊ฐ ์๋๋ผ ๋ ๋ฆฝ๋ appํํ๋ก tishadow๋ฅผ ์ฌ์ฉํ๊ณ ์ถ์ ๋๋ appify๋ฅผ ํตํด TiShadow app์ ๋์ ํ ํน์ ์ฑ ์ ์ฉ Tishadow app์ ๋ง๋ค๋ฉด ๋๋ค. Appify๋ฅผ ํตํด ์์ฑํ๋ฉด ์๋ฒ์ฐ๊ฒฐ์ ๋ณด๊ฐ ํฌํจ๋์ด ์๋ ์ฐ๊ฒฐํ๊ฒ ๋๋ค. ๋ํ appify๋ฅผ ํ๊ฒ๋๋ฉด ์ฑ์ ์ค์ ๋ ๋ชจ๋์ ํฌํจํ์ฌ tiapp.xml ์ค์ ์ ๋์ผํ๊ฒ ๋ณต์ฌํด์ค๋ค.
tishadow server๋ฅผ ์คํํ๋ค.
appifyํ ํ๋ก์ ํธ๋ก ๊ฐ์ tishadow appify ๋ช ๋ น์ด๋ฅผ ์ด์ฉํ์ฌ appify๋ ์ ์ฉ Tishadow ์ฑ์ ๋ง๋ ๋ค. ip๋ฐ folder tishadow appify -o 192.168.0.2 -r room_appify_ios -d ../AlloySandboxAppify
๋ง๋ค์ด์ง Appify๋ ์ ์ฉ Tishadow์ฑ์ ์คํํ๋ค. : titanium build -p ios
์๋ ํ๋ก์ ํธ ํด๋๋ก ๊ฐ์ ํ์ผ์ ์์ ํ๊ณ tishadow run ํ๋ค.
์ฌ์ฉ๋ฒ์ TiShadow Github์ด๋ ์๋ ๋์์์ ํตํด์๋ ํ์ธ ํ ์ ์๋ค.
Appify์ ์ดํด์ ์์ด ์ฃผ์ํ ์ ์ Appify ๋ช ๋ น์ ํตํด ์์ฑ๋ ํ๋ก์ ํธ๋ ๋จ์ง ์๋ ์ ์๋๋ tishadow app์ผ๋ฟ์ด๋ค. ๋ง๋ค๊ณ ์๋ ํ๋ก์ ํธ๊ฐ ์๋๋ค. ์๋ ํ๋ก์ ํธ์์ ์์ ์ ๊ณ์ํ๊ณ appify๋ ํ๋ก์ ํธ๋ก ์์ฑ๋ ์ฑ(์ ์ฉ tishadow app)์์ ํ์ธํ๋ ๊ฒ์ด๋ค.
Alloy ์ฌ์ฉ์ ์ฃผ์์
tishadow๋ resource ํด๋์ ๋ด์ฉ์ ์ ๋ฌํ๋ค. ๋ฐ๋ผ์ alloy๋ก ๋ ํ๋ก์ ํธ์์ app ํ๋ก์ ํธ ๋ฐ์ ํ์ผ์ ์์ ํ ๊ฒฝ์ฐ๋ผ๋ฉด alloy compile -c platform=android ๋ฅผ ์คํํ์ฌ alloy ์ปดํ์ผ์ ํ ํ tishadow run์ ์คํํด์ผ ํ๋ค. ์๋์ ๊ฐ์ด ํ๋์ ๋ช ๋ น์ผ๋ก๋ ํ๋ฉด ํธ๋ฆฌํ๋ค. alloy compile -c platform=android && tishadow run
ํ์ผ ๋ณ๊ฒฝ์ ์๋ tishadow run ์คํ๋ฐฉ๋ฒ
ํ์ผ์ ์์ ํ๊ณ ํ์ธํ๊ธฐ ์ํด ๋งค๋ฒ ์ ๋ช ๋ น์ ์คํํด์ผํ๋๋ฐ ์ด๊ฒ ๊ท์ฐฎ๋ค๋ฉด ์ด๋ฅผ ์๋์ผ๋ก ํด์ฃผ๋ supervisor node pakage๋ฅผ ์ด์ฉํ์ฌ ํด๊ฒฐ ํ ์ ์๋ค. ๋ฐฉ๋ฒ์ https://gist.github.com/kwhinnery/5565515 ์ ๋์์๋ค. (alloy ํ๋ก์ ํธ์ ๊ฒฝ์ฐ๋ /app ํด๋ ๋ฐ์ ํ์ผ์ ๋ณ๊ฒฝํ๋ฉด ์๋์ผ๋ก compileํ๊ณ tishadow run ํ๊ฒ ํ ์ ์์)
์ฐธ๊ณ ๋ก TiShadow์ Hockeykit์ ์ด์ฉํ์ฌ ํ ์คํธ/๋ฐฐํฌ ์๋ ๋์ด๊ธฐ ์ํ ์คํ๋ผ์ธ ์ธ๋ฏธ๋๋ฅผ ๊ณง ๊ฐ์ ์์ ์ ๋๋ค. ์์ธํ ์ฌํญ์ ํ๊ตญ Titanium ๊ฐ๋ฐ์ ์ปค๋ฎค๋ํฐ ํฌ๋ผ http://tidev.kr ์ด๋ facebook ๊ทธ๋ฃน http://tidev.kr/fb ๋ฅผ ํตํด ๊ณง ๊ณต์งํ๊ฒ ์ต๋๋ค.
์์ ๋ค์ดํฐ๋ธ ํ๋ก์ ํธ์ Titanium ํ๋ก์ ํธ์ ๋น๋ ์๊ฐ ์ฐจ์ด๋ ๋จ์ํ ์ฑ์ผ์๋ก ๋ ์ฐจ์ด๋๋ค. Titanium์ ๋จ์ํ ์ฑ์ด์ด๋ ๊ธฐ๋ณธ์ ์ผ๋ก ํฌํจ๋๋ TiSDK๊ฐ ์๊ธฐ ๋๋ฌธ์ด๋ค.ย โฉ๏ธ
์ฑ์ ์์ ํ ์ข ๋ฃํ๋ค๊ฐ ๋ค์ ์คํํด์ฃผ๋ ๊ฒ์ด ์๋๊ธฐ ๋๋ฌธ์ ํ์์ ๋ฐ๋ผ ๊ธฐ์กด์ app.js๋ฅผ ์์์ผ๋ก ์คํ๋์๋ ์ ๋ฆฌ๋ฅผ ํ๋ ์ฝ๋๊ฐ ํ์ํ ๋๊ฐ ์๋ค.(window ์ข ๋ฃ, ๊ธ๋ก๋ฒ ๋ณ์ ์ด๊ธฐํ ๋ฑ.) ์ด ์ ๋ฆฌ๋ฅผ ํ๋ ๋ฐฉ๋ฒ์ TiShadow Github ์ ์ฅ์์ Keep in Clean๋ถ๋ถ์ ์ฐธ์กฐ๋ฐ๋๋ค. alloy์ ๊ฒฝ์ฐ alloy.jmk ์ค์ ์ ํด์ผํ๋๋ฐ ์ด๋ถ๋ถ๋ ์ค๋ช ๋์ด ์๋ค.ย โฉ๏ธ
AlloyXMLMarkup-ConditionalCode , AlloyStylesandThemes-Platform-SpecificStylesย โฉ๏ธ
http://docs.appcelerator.com/titanium/3.0/#!/guide/Alloy_Controllers-section-34636384_AlloyControllers-ConditionalCodeย โฉ๏ธ









