Devotion first.
Detachment first.
There are statements which suggest that there cannot be any devotion without detachment. It seems correct. Why are we not practicing devotion? The straight answer is we like the worldly objects and worldly persons more than God. Hence our mind wants to think about this world and obviously the mind will not think of God. Thus devotion is not possible without detachment.
The other view is detachment cannot be there without devotion. This seems correct too. Why don't we have detachment? Because our heart is impure. The more the impure the mind, the more will be attachment to this world and obviously less will be detachment.
How does mind is purified? Only through devotion. The impure mind cannot have detachment. Thus it follows that devotion precedes detachment.
How to solve this riddle of type seed first or tree first?
The answer is devotion and detachment happen simultaneously. That is what Krishn suggests in Gita, 'Practice with detachment is the key.'
Practice is to forced effort to apply mind to God. It could be done with constantly contemplating on the effervescent nature of life, selfish world and sufferings to which soul is subjected in its life time.
Consider a beam balance which is heavily biased on one side. The weight in one pan is too high. A person shifts some portion from heavy pan to lighter pan. The heavier pan becomes lighter to the same extent to which lighter pan becomes heavier.
Thus detachment is developed to the extent to which mind is engrossed in God. Devotion is the love. Detachment and knowledge are the sons of devotion and hence they are automatic. No separate efforts are expected. Devotion does not need any support from anything else.
When light enters, darkness is gone. Both are simultaneous. Same way, bring in devotion, material attachment is gone. Both are simultaneous.