Add device smack rule and fix build erros when using mobile spec.