I guess you are using a Makefile depending on this file (or a similar rule):
https://github.com/DHowett/theos/blob/master/makefiles/package/deb.mk
It requires that dpkg-deb
is in the path or will fail with the error message you posted.
You say you installed dpkg, but this doesn't mean an executable called dpkg-deb
is available to make when invoked from Xcode. Indeed, with your external build system, make is invoked with a restricted PATH. Your solution of installing dpkg-deb and copying to /Applications/Xcode.app/Contents/Developer/usr/bin/
is quite dirty and involves installing the missing binary in Xcode itself, in the first directory of the default PATH.
Alternatively, you can modify the PATH directly from Xcode, by checking "Pass build settings in environment" (this is the default) and adding a PATH build setting. Ideal value would be ${inherited}:/usr/local/bin
or ${inherited}:/opt/local/bin
depending on where dpkg-deb
is actually installed.