如何为设备和模拟器设置不同的产品名称

时间:2022-12-15 20:44:12

For example I want my project to build a target named "mylib_ios.a" for device and "mylib_sim.a" for simulator.

例如,我希望我的项目为设备构建名为“mylib_ios.a”的目标,为模拟器构建“mylib_sim.a”目标。

Edit: I want it change automatically when I build for simulator or device. Do I need a xconfig file?

编辑:当我为模拟器或设备构建时,我希望它自动更改。我需要一个xconfig文件吗?

1 个解决方案

#1


0  

  1. Right click on the target mylib_ios.a under TARGETS in Xcode and then select Duplicate.
  2. 右键单击Xco​​de中TARGETS下的目标mylib_ios.a,然后选择Duplicate。
  3. Select the "my_lib_ios.a copy" under TARGETS. Under Build Settings, search for "product name", rename it to mylib_sim.a
  4. 在TARGETS下选择“my_lib_ios.a copy”。在“构建设置”下,搜索“产品名称”,将其重命名为mylib_sim.a
  5. You can also rename the target by click on it once again.
  6. 您还可以再次单击它来重命名目标。

#1


0  

  1. Right click on the target mylib_ios.a under TARGETS in Xcode and then select Duplicate.
  2. 右键单击Xco​​de中TARGETS下的目标mylib_ios.a,然后选择Duplicate。
  3. Select the "my_lib_ios.a copy" under TARGETS. Under Build Settings, search for "product name", rename it to mylib_sim.a
  4. 在TARGETS下选择“my_lib_ios.a copy”。在“构建设置”下,搜索“产品名称”,将其重命名为mylib_sim.a
  5. You can also rename the target by click on it once again.
  6. 您还可以再次单击它来重命名目标。