Save 37% off PRO during our Black Friday Sale! »

Switching Icon.png depending on each environment

Switching Icon.png depending on each environment

84e9eed4cd2df442347ff56aae03868c?s=128

Naoki ISHIKAWA

November 13, 2013
Tweet

Transcript

  1. Switching Icon.png depending on each environment #potatotips 1, @jarinosuke

  2. ࣄྫ • ϦϦʔεࡁΈͷΞϓϦΛ্ॻ͖ͨ͘͠ͳ͍ͷͰɺ Debug or AdHoc Ϗϧυ͸ผͷ bundle identifiler ࢖༻

    • ؀ڥຖʹ֬ೝ͍ͨ͠
  3. Ͳ͕ͬͪ ຊ൪༻͚ͩͬ…

  4. ͜͏Ͱ͖·͢

  5. ར఺ • ΞϓϦΛ্ཱͪ͛ͳͯ͘΋؀ڥ͕෼͔Δ • ։ൃϏϧυͷ഑෍ͷະવ๷ࢭ

  6. ํ๏ 1. User-Defined Macro ͷ௥Ճ 2. ରԠͨ͠ Resource ͷ௥Ճ 3.

    Scriptͷ௥Ճ
  7. 1.User-Defined Macro ͷ௥Ճ 1. (Xcode 5ͷΈ) Project ϑΝΠϧΛબ୒ޙɺϝ χϡʔ͔Β Editor->Add

    Build Setting->Add User-Defined Setting 2. User-Defined Λબ୒͠ɺҎԼͷཁྖͰهड़
  8. 2.ରԠ Resource ͷ௥Ճ • User-Defined Ͱࢦఆͨ͠਺͚ͩͷ Resource Λ ௥Ճ

  9. 3. Script ͷ௥Ճ • (Xcode 5ͷΈ) Project ϑΝΠϧΛબ୒ޙɺϝ χϡʔ͔Β Editor->Add

    Build Phase->Add Run Script Build Phase • ҎԼͷΑ͏ͳ shell script Λೖྗ cp Test/${PHASE}_Icon-60h@2x.png ${TARGET_BUILD_DIR}/${PRODUCT_NAME}.app/Icon@2x.png !9
  10. Ԡ༻ฤ • seed ͱͳΔ plist ϑΝΠϧͷࣗಈੜ੒ • ΞΠίϯͷࣗಈੜ੒

  11. ͝ਗ਼ௌ͋Γ͕ͱ͏͟͝ ͍·ͨ͠ʂ