Step 1: First of all, download and install the Automateit app. This app needs root access. So, make sure to grant the root permission.
Step 2: Next, select ‘My Rules’ and tap on the (+) icon.
Step 3: In the next screen tap on the ‘Call State Trigger’
Step 4: Now, choose the option ‘Incoming Call’
Step 5; In the next step, select the contact. You can choose from saved contacts or can create a new one.
Step 6: Now tap on ‘Next’ and on the next screen, select ‘Shutdown Device Action’
Step 7: Now you need to provide the name for the rule and save the rule.
Now you just need to make a call from the contact you specified and your Android device will be shut down.
NOT TESTED BY ME.