US Customs and Border Patrol launched the Mobile Passport app a year ago at the Atlanta airport and expanded it to Miami at the start of this year. I downloaded it this spring before going to Morocco. When you download the app you enter in your passport information and add a selfie of yourself. On the plane before arriving stateside, open up the app create a new trip and answer all of the standard customs questions you would normally answer on the Customs card, save the trip, once you land, connect to your provider or WiFi, submit the trip to Customs and in a few seconds you’ll get a barcode downloaded on your phone. When you get to passport control and customs just go to the designated line and swipe your phone. No forms, and in my case no questions because they basically already had all your details.
Since March they’ve expanded the service out to Seattle, San Francisco and Chicago, and I’m sure there will be more. The app is free and on Google Play and iTunes.